Most of the times comments are used for internal purpose. This need not go with the workbbok, here is the way to remove it
Sub Remove_Comments_From_WKBK()
'
' Remove Comments from Excel 2007 Workbook
'
'
ActiveWorkbook.RemoveDocumentInformation (xlRDIComments)
End Sub
If you want the same for Excel 2003 and before here is the code
Sub Remove_Comments_From_WKBK_2003()
'
' Remove Comments from Excel 2003 Workbook
'
'
Dim wks As Worksheet
Dim cmnt As Comment
For Each wks In ActiveWorkbook.Sheets
For Each cmnt In wks.Comments
cmnt.Delete
Next cmnt
Next
End Sub
Sub ShowFolderList()
ReplyDeleteDim fs, f, f1, fc, s, fr, r, D, WSN
Dim folderspec
Dim I As Integer
'Delete all the worksheets
Workbooks.Add
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For I = ActiveWorkbook.Worksheets.Count To 1 Step -1
If Worksheets(I).Name <> "Sheet1" Then Worksheets(I).Delete
Next I
'Insert worksheet with folder name
folderspec = "D:\Dinakaran" 'CurDir()
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 In fc
With ActiveWorkbook.Sheets.Add
ActiveSheet.Name = f1.Name
End With
Next
'Delete Sheet1
ActiveWorkbook.Sheets("Sheet1").Delete
Application.ScreenUpdating = True
Application.DisplayAlerts = True
'List all the files
For Each xlSheet In ActiveWorkbook.Worksheets
WSN = xlSheet.Name
D = "D:\Dinakaran\" & WSN & "\"
xlSheet.Cells(1, 1) = "Filenames"
r = 2
fr = Dir(D, 7)
Do While fr <> ""
xlSheet.Cells(r, 1) = fr
r = r + 1
fr = Dir
Loop
'r = 0
Next xlSheet
End Sub