Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Excel Programmers,
Excel 2000, xp pro I'm using the code below to clear unlocked cells. I call this procedure with three command buttons, 1. cmdReset-used to exit quote without printing 2. cmdAddPart-used to add another part number for the same customer 3. cmdComplete-used to print and store quote when the associate wants to add a part, I need to keep the customer id in cell D4 and clear all other unlocked cells. when the associate resets or completes, I need to clear cell D4 along with all other unlocked cells. Does anyone have any suggestions? Thanks, Dan -------------------------------------------------------------------------------------- Sub Clear_Unlocked2() 'clears the unlocked cells in range A1:N100 including merged cells Dim myCell As Range Application.EnableEvents = False For Each myCell In Range("A1:N100") If myCell.Locked = False Then If myCell.MergeCells Then If myCell.Address = myCell.MergeArea(1).Address Then myCell.MergeArea.ClearContents End If Else myCell.ClearContents End If End If Next myCell Range("A6").Select Selection.End(xlUp).Select Range("A2:C2").Select Application.EnableEvents = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
clear unlocked cells macro help please | Excel Worksheet Functions | |||
Macro: Clear contents of unlocked cells | Excel Programming | |||
How can I have formatting options like merge cells ,Bold,active for the unlocked cells of the protected worksheet.Is it possible in excel? | Excel Programming | |||
Moving from unlocked cells to unlocked cells in an excel form | Excel Worksheet Functions | |||
Selecting only unlocked cells to clear | Excel Programming |