Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
clear data from selected cells
Hello, I have a excel tempate for compiling data. How do I add a Control
button to clear data in unprotected cells only? Can you help? Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
clear data from selected cells
I assume you are looking of code and not how to add a button to a sheet
for each cell in Activesheet.UsedRange if cell.Locked = False then cell.ClearContents end if Next -- Regards, Tom Ogilvy "Steve" wrote in message ... Hello, I have a excel tempate for compiling data. How do I add a Control button to clear data in unprotected cells only? Can you help? Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
clear data from selected cells
Hi Tom,
Yes, I already have a macro and button. I added protected cells to range, I can't seem to edit the macro without errors. Current macros: Sub clear() ' ' clear Macro ' Macro recorded 1/15/2006 by steve smith ' ' Range("B2:G10").Select Range("B2").Activate Selection.ClearContents End Sub I am fairly new to VB. Thank You, Steve "Tom Ogilvy" wrote: I assume you are looking of code and not how to add a button to a sheet for each cell in Activesheet.UsedRange if cell.Locked = False then cell.ClearContents end if Next -- Regards, Tom Ogilvy "Steve" wrote in message ... Hello, I have a excel tempate for compiling data. How do I add a Control button to clear data in unprotected cells only? Can you help? Steve |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
clear data from selected cells
Sub clear()
' ' clear Macro ' Macro recorded 1/15/2006 by steve smith ' ' Dim cell as Range Range("B2:G10").Select Range("B2").Activate for each cell in selection if cell.locked = false then cell.ClearContents end if Next End Sub should work I would think. -- Regards, Tom Ogilvy "Steve" wrote in message ... Hi Tom, Yes, I already have a macro and button. I added protected cells to range, I can't seem to edit the macro without errors. Current macros: Sub clear() ' ' clear Macro ' Macro recorded 1/15/2006 by steve smith ' ' Range("B2:G10").Select Range("B2").Activate Selection.ClearContents End Sub I am fairly new to VB. Thank You, Steve "Tom Ogilvy" wrote: I assume you are looking of code and not how to add a button to a sheet for each cell in Activesheet.UsedRange if cell.Locked = False then cell.ClearContents end if Next -- Regards, Tom Ogilvy "Steve" wrote in message ... Hello, I have a excel tempate for compiling data. How do I add a Control button to clear data in unprotected cells only? Can you help? Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to clear multiple cells of input data in Excel simultaneously | Excel Worksheet Functions | |||
How do I clear a column of data without clearing specific cells? | Excel Discussion (Misc queries) | |||
Can I lock data into few cells in sheet and clear the rest | Excel Discussion (Misc queries) | |||
Automatically clear values from a range of selected cells | Excel Discussion (Misc queries) | |||
How do I clear data in selected cells automatically | Excel Discussion (Misc queries) |