Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I Clear range of cells (e.g. a1,,a10) using a command button on a
worksheet??? I want to use VBA. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hitu, use this code for your command button
Range("A1:A10").ClearContents -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Hitu" wrote in message ... How can I Clear range of cells (e.g. a1,,a10) using a command button on a worksheet??? I want to use VBA. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
make the control toolbox toolbar visible. Click on the commandbutton and
then rubberband its location on the worksheet. You will be in design mode. Double click on the command button and you should see Private Sub Commandbutton1_Click() End Sub in the procedure put your code Private Sub Commandbutton1_Click() Range("A1:A10").Clear End Sub go back to the worksheet (alt+F11), then click the button on the upper left corner of the commandbar to get out of design mode. Now click the button and it should clear the cells. -- Regards, Tom Ogilvy "Hitu" wrote: How can I Clear range of cells (e.g. a1,,a10) using a command button on a worksheet??? I want to use VBA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cells.Clear | Excel Discussion (Misc queries) | |||
clear contents cells of unprotected cells | Excel Programming | |||
Clear Cells | Excel Discussion (Misc queries) | |||
Clear cells with #N/A | Excel Programming | |||
Clear cells range if certain cells are all empty | Excel Programming |