![]() |
Excel VBA help
Greetings. I am trying to add a simple (or so it would seem) script
to an excel workbook, and having spent the weekend trying to find how, am now turning to this group for help. I have created a command button in a worksheet. I need this button to keep a tally, so to speak. Essentially, I have one cell that is going to increase in value by a factor of one each time the button is clicked. So, as an example, cell B18 = 1. Command Button is clicked once, B18 now equals 2, etc. Can this be done via VB in excel? It would seem simple to do, but I am stumped. Any help is appreciated. Thanks! |
Excel VBA help
Sub Button1_Click()
With ActiveSheet.Range("B18") .Value = .Value + 1 End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "tmobccr2" wrote in message oups.com... Greetings. I am trying to add a simple (or so it would seem) script to an excel workbook, and having spent the weekend trying to find how, am now turning to this group for help. I have created a command button in a worksheet. I need this button to keep a tally, so to speak. Essentially, I have one cell that is going to increase in value by a factor of one each time the button is clicked. So, as an example, cell B18 = 1. Command Button is clicked once, B18 now equals 2, etc. Can this be done via VB in excel? It would seem simple to do, but I am stumped. Any help is appreciated. Thanks! |
Excel VBA help
On Sun, 03 Jun 2007 15:11:53 -0700, tmobccr2 wrote:
Greetings. I am trying to add a simple (or so it would seem) script to an excel workbook, and having spent the weekend trying to find how, am now turning to this group for help. I have created a command button in a worksheet. I need this button to keep a tally, so to speak. Essentially, I have one cell that is going to increase in value by a factor of one each time the button is clicked. So, as an example, cell B18 = 1. Command Button is clicked once, B18 now equals 2, etc. Can this be done via VB in excel? It would seem simple to do, but I am stumped. Any help is appreciated. Thanks! It should be simple. How did you create the button? --ron |
Excel VBA help
Have you looked at using a simple Spinner button from the Forms Toolbar?
Gord Dibben MS Excel MVP On Sun, 03 Jun 2007 15:11:53 -0700, tmobccr2 wrote: Greetings. I am trying to add a simple (or so it would seem) script to an excel workbook, and having spent the weekend trying to find how, am now turning to this group for help. I have created a command button in a worksheet. I need this button to keep a tally, so to speak. Essentially, I have one cell that is going to increase in value by a factor of one each time the button is clicked. So, as an example, cell B18 = 1. Command Button is clicked once, B18 now equals 2, etc. Can this be done via VB in excel? It would seem simple to do, but I am stumped. Any help is appreciated. Thanks! |
All times are GMT +1. The time now is 01:59 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com