Sub to freeze all sheets & delete all comments

M

Max

Hunting for a sub to freeze all sheets (copy entire sheet>paste special as
values) & delete all comments (in all sheets) in a book. Thanks.
 
J

Joel

For Each sht In Sheets
sht.Cells.Copy
sht.Cells.PasteSpecial past:=xlPasteValues

Next sht
 
C

Charabeuh

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
--------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top