Basic VBA help

JustaJerk

Experienced
Joined
Jul 12, 2006
Posts
96
Okay, so the title might be a little redundant...

I tried to toy around with VBA in Excel. Unfortunately, the help files not installed and the install CDs aren't biting me in the ass.

I have Office97 running on Win98 second edition.

All I really want to do is add a button on the spreadsheet that will increment a cell. I can get the button on the worksheet, edit the code to L9=L9+1, but when I press the button, nothing happens.

Step by step instructions for this programming idiot would be greatly appreciated.

Thanks,
JustaJerk
 
That should be pretty straightforward.

Go to the VBA editor and select your command button on the left dropdown list, and "click" on the right one.

Enter the following code:

Dim x As Long

x = Range("A1").value
x = x + 1
Range("A1").value = x

Obviously you need to replace A1 with whatever cell you are using - if that is the cell you are using replace it with L9.
Hope this helps
 
Back
Top