View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Charabeuh[_3_] Charabeuh[_3_] is offline
external usenet poster
 
Posts: 19
Default Sub to freeze all sheets & delete all comments

Something like that :?

--------------------------------------------------------------
Sub PastValDelComments()
Dim dlgAnswer As Boolean, S As String
Dim OldName As String, NewName As String
Dim xWs As Worksheet
dlgAnswer = False

' SAVE workbook with another name or path
S = "SECURITY : save your worbook with another name, please" & vbCrLf
S = S & vbCrLf & " == with another Name or Path <=="
OldName = ThisWorkbook.Path & "\" & ThisWorkbook.Name

While Not dlgAnswer Or (OldName = NewName)
MsgBox S
dlgAnswer = Application.Dialogs(xlDialogSaveAs).Show
NewName = ThisWorkbook.Path & "\" & ThisWorkbook.Name
Wend

For Each xWs In Worksheets
xWs.Cells.Copy
xWs.Cells.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
xWs.Cells.ClearComments
Next xWs

ThisWorkbook.Save

End Sub
--------------------------------------------------------------





"Max" a écrit dans le message de
...
Hunting for a sub to freeze all sheets (copy entire sheetpaste special as
values) & delete all comments (in all sheets) in a book. Thanks.