Is there a way where I can specify in code to select all unprotected cells and delete what ever is in it?
Thanks in advance
mustanggt
Is there a way where I can specify in code to select all unprotected cells and delete what ever is in it?
Thanks in advance
mustanggt
Hi,
Try
VBA NoobSub ClearUnlocked() Dim rng As Range Dim cell As Range If ActiveSheet.ProtectContents Then ActiveSheet.Protect UserInterFaceOnly:=True End If Set rng = ActiveSheet.Cells.SpecialCells(xlConstants) For Each cell In rng If cell.Locked = False Then cell.ClearContents End If Next End Sub
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
VBA Noob,
Thank you again...that works excellent.
mustanggt
No problem
Thx for the feedback
VBA Noob
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks