Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In my spreadsheet, I have a clear button (coded below). The whole
sheet (all cells) are locked except range E5 - E12 , G3 and G5 through G12 which are unlocked. What I want to do upon click of the clear button is for the the cells in E5-E12 & G3 to be cleared leaving the unprotected cell range G5 through G12 uncleared then of course leaving all other locked cells alone. What can I add or change in my code to accomplish this? Private Sub ClearButton1_Click() Dim cell As Range Range("E5:E12", "G3").Select For Each cell In Selection If cell.Locked = False Then cell.ClearContents End If Range("G3").Select Range("G3").Activate Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need someone to help tweak a code | Excel Discussion (Misc queries) | |||
shorten connection time <<Macro Tweak needed | Excel Programming | |||
clear option buttons **MACRO TWEAK** | Excel Programming | |||
Code Tweak | Excel Programming | |||
Need final code tweak | Excel Programming |