Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Try this. It will work provided that there are at least two unprotected cells on more than one line in each sheet. You can sustitute "ActiveWorkbook.Sheets.Count" with 32 if your described sheets are placed first or are the only existing sheets in the workbook . Sub ClearAllUnlockedCellsOnAllSheets() For N = 1 To ActiveWorkbook.Sheets.Count R = 0 ActiveWorkbook.Sheets(N).Activate ActiveWorkbook.Sheets(N).Range("A1").Activate Do If ActiveCell.Locked = False Then ActiveCell.ClearContents End If R = ActiveCell.Row ActiveCell.Next.Activate Loop Until ActiveCell.Row < R Next N End Sub Best regards Jonas Lindh -- Jonas Lindh ------------------------------------------------------------------------ Jonas Lindh's Profile: http://www.excelforum.com/member.php...o&userid=31346 View this thread: http://www.excelforum.com/showthread...hreadid=526317 |