Adding a command button to my Excel worksheet

  • Thread starter Thread starter bishy
  • Start date Start date
B

bishy

I am trying to add a command button to a worksheet, wot i want th
button to do is to delete the contents of a column when the button i
clicked, can anyone help me with the code and wot to do.
Thanks :
 
Hi
do you want to delete a specific row?
try the following as starting point:
- insert a commandbutto (using the toolbox toolbar) -> Drag the button
on your sheet
- right click on this button, choose 'code' and enter the following in
the VBA editor
Private Sub CommandButton1_Click()
Me.Rows(4).Delete
End Sub
- close the VBA editor,
- toggle the 'design mode'

Try clicking the button: It will delete row 4
 
I have created the command button and what i want it to do is to delet
the contents of a column in my Spreadsheet, eg. in the column numbers
i have 1, 2 ,3 , 4 and when i press the clear button i want thes
numbers to be deleted and then i want to be able to add other number
in place of these.
thanks :
 
The reason why i thought of using command buttons is that my spreadshee
has a lot of rows in and i thought it would be easier to hit one butto
so i was just wondering if anyone could help me.
thanks :
 
Hi
if you want do delete all rows for some columns just click on the
column header to select the entire column and hit DEL
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top