Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am looking to set up a clear button on sheet 1 that when clicked on will
clear various cells on sheet two. I have a clear button on sheet 1 that when clicked clears cells on sheet 1 that reads; Range("A1:A77").ClearContents but when I try to put that cammand button on page one to clear cells on page two I can't get the proper script that works. any help is appreciated. Dorothy |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Change the command to Worksheets("Sheet2").Range("A1:A77").ClearContents
"Dorothy" wrote in message ... I am looking to set up a clear button on sheet 1 that when clicked on will clear various cells on sheet two. I have a clear button on sheet 1 that when clicked clears cells on sheet 1 that reads; Range("A1:A77").ClearContents but when I try to put that cammand button on page one to clear cells on page two I can't get the proper script that works. any help is appreciated. Dorothy |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Dorothy
If it is a Non Contigious range try Worksheets("Sheet2").Range("A1;A77;B6;D15;G5").Cle arContents etc,etc, HTH Michael M "Castell" wrote: Change the command to Worksheets("Sheet2").Range("A1:A77").ClearContents "Dorothy" wrote in message ... I am looking to set up a clear button on sheet 1 that when clicked on will clear various cells on sheet two. I have a clear button on sheet 1 that when clicked clears cells on sheet 1 that reads; Range("A1:A77").ClearContents but when I try to put that cammand button on page one to clear cells on page two I can't get the proper script that works. any help is appreciated. Dorothy |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
But don't use semicolons.
Worksheets("Sheet2").Range("A1,A77,B6,D15,G5").Cle arContents or maybe Worksheets("Sheet2").Range("A1:A77,B6:D15,G5").Cle arContents Michael M wrote: Dorothy If it is a Non Contigious range try Worksheets("Sheet2").Range("A1;A77;B6;D15;G5").Cle arContents etc,etc, HTH Michael M "Castell" wrote: Change the command to Worksheets("Sheet2").Range("A1:A77").ClearContents "Dorothy" wrote in message ... I am looking to set up a clear button on sheet 1 that when clicked on will clear various cells on sheet two. I have a clear button on sheet 1 that when clicked clears cells on sheet 1 that reads; Range("A1:A77").ClearContents but when I try to put that cammand button on page one to clear cells on page two I can't get the proper script that works. any help is appreciated. Dorothy -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
To be more specific, I am trying to get a clear button on page one that when
clicked will clear all unprotected cells on pages 2, 3 and 4 "Dorothy" wrote: I am looking to set up a clear button on sheet 1 that when clicked on will clear various cells on sheet two. I have a clear button on sheet 1 that when clicked clears cells on sheet 1 that reads; Range("A1:A77").ClearContents but when I try to put that cammand button on page one to clear cells on page two I can't get the proper script that works. any help is appreciated. Dorothy |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Sub UnLocked_Cells()
Dim cell As Range, tempR As Range, rangeToCheck As Range Dim ws As Worksheet For Each ws In ActiveWorkbook.Sheets(Array _ ("Sheet2", "Sheet3", "Sheet4")) ws.Activate For Each cell In ActiveSheet.UsedRange If Not cell.Locked Then cell.ClearContents End If Next cell Next ws End Sub You should get used to referring to worksheets as "sheets" rather than "pages" which is generally used to designate printed sheets of paper. Gord Dibben MS Excel MVP On Sun, 6 Apr 2008 14:39:01 -0700, Dorothy wrote: To be more specific, I am trying to get a clear button on page one that when clicked will clear all unprotected cells on pages 2, 3 and 4 "Dorothy" wrote: I am looking to set up a clear button on sheet 1 that when clicked on will clear various cells on sheet two. I have a clear button on sheet 1 that when clicked clears cells on sheet 1 that reads; Range("A1:A77").ClearContents but when I try to put that cammand button on page one to clear cells on page two I can't get the proper script that works. any help is appreciated. Dorothy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to make a macro to clear multiple cells from multiple worksheets? | Excel Worksheet Functions | |||
macro to clear cells | Excel Discussion (Misc queries) | |||
Macro to clear contents of unprotected cells AND drop down boxes | Excel Discussion (Misc queries) | |||
Clear shhet with macro | Excel Discussion (Misc queries) | |||
Macro to clear cells | Excel Discussion (Misc queries) |