Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Is there a way, via a macro or some such, that I could add one to the value
of a cell by pushing a button or something, rather than having to manually change the value? |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Yes,
Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Or you could try:
Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
You can try a Spinner:
http://office.microsoft.com/en-us/he...265211033.aspx Regards, Ryan-- "Corey" wrote: Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I cannot get the macro to work. I can't say I'm really a macro expert. I
tried it using m as the form button, but it wouldn't work. If it's not too much trouble, could someone explain the process? Microsoft Help didn't really get it done for me... "Corey" wrote: Or you could try: Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#6
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
1. Place a Forms Button on the worksheet
2. It will prompt you to set a macro to it 3. Selecte the NEW option 4. Between the Sub Button1_Click() and the End Sub place the code With Sheet1 ..Select If activecell.value <"" then Activecell.value = Activecell.value + 1 end if end with Will look like: Sub Button1_Click() With Sheet1 ' Does the following with the Sheet selected ..Select ' Selects the Sheet above If activecell.value <"" then ' Check to see if the Cell that is selected has No Value in it, if No Value then doe the following Activecell.value = Activecell.value + 1 ' Changes the value of the ActiveCell to ADD 1 to the value end if ' End of the IF statement (If ActiveCell is empty) end with ' End of the With Statement (Sheet) ' Ends the SUB Routine End Sub Corey.... "Excel Noob" wrote in message ... I cannot get the macro to work. I can't say I'm really a macro expert. I tried it using m as the form button, but it wouldn't work. If it's not too much trouble, could someone explain the process? Microsoft Help didn't really get it done for me... "Corey" wrote: Or you could try: Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#7
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
It keeps saying the ..Select thing is a syntax error. It's highlighted in
blue and the Sub Button1_Click() line is highlighted yellow. It also sometimes says error: expected:case. "Corey" wrote: 1. Place a Forms Button on the worksheet 2. It will prompt you to set a macro to it 3. Selecte the NEW option 4. Between the Sub Button1_Click() and the End Sub place the code With Sheet1 ..Select If activecell.value <"" then Activecell.value = Activecell.value + 1 end if end with Will look like: Sub Button1_Click() With Sheet1 ' Does the following with the Sheet selected ..Select ' Selects the Sheet above If activecell.value <"" then ' Check to see if the Cell that is selected has No Value in it, if No Value then doe the following Activecell.value = Activecell.value + 1 ' Changes the value of the ActiveCell to ADD 1 to the value end if ' End of the IF statement (If ActiveCell is empty) end with ' End of the With Statement (Sheet) ' Ends the SUB Routine End Sub Corey.... "Excel Noob" wrote in message ... I cannot get the macro to work. I can't say I'm really a macro expert. I tried it using m as the form button, but it wouldn't work. If it's not too much trouble, could someone explain the process? Microsoft Help didn't really get it done for me... "Corey" wrote: Or you could try: Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#8
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
1. Make sure the Button name is correct, i used Button1, but this need not be the case if you
have more than 1 already 2. If you right click the button and select Asign Macro the code between the grey lines should have: Sub Button1_Click() With Sheet1 ..Select If ActiveCell.Value < "" Then ActiveCell.Value = ActiveCell.Value + 1 End If End With End Sub 3. Make sure there is only ONE fullstop in the line .Select ctm "Excel Noob" wrote in message ... It keeps saying the ..Select thing is a syntax error. It's highlighted in blue and the Sub Button1_Click() line is highlighted yellow. It also sometimes says error: expected:case. "Corey" wrote: 1. Place a Forms Button on the worksheet 2. It will prompt you to set a macro to it 3. Selecte the NEW option 4. Between the Sub Button1_Click() and the End Sub place the code With Sheet1 ..Select If activecell.value <"" then Activecell.value = Activecell.value + 1 end if end with Will look like: Sub Button1_Click() With Sheet1 ' Does the following with the Sheet selected ..Select ' Selects the Sheet above If activecell.value <"" then ' Check to see if the Cell that is selected has No Value in it, if No Value then doe the following Activecell.value = Activecell.value + 1 ' Changes the value of the ActiveCell to ADD 1 to the value end if ' End of the IF statement (If ActiveCell is empty) end with ' End of the With Statement (Sheet) ' Ends the SUB Routine End Sub Corey.... "Excel Noob" wrote in message ... I cannot get the macro to work. I can't say I'm really a macro expert. I tried it using m as the form button, but it wouldn't work. If it's not too much trouble, could someone explain the process? Microsoft Help didn't really get it done for me... "Corey" wrote: Or you could try: Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#9
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Sorry, might be my fault with the 2 x fullstops in the SELECT line.
There is ONLY one. "Corey" wrote in message ... 1. Make sure the Button name is correct, i used Button1, but this need not be the case if you have more than 1 already 2. If you right click the button and select Asign Macro the code between the grey lines should have: Sub Button1_Click() With Sheet1 ..Select If ActiveCell.Value < "" Then ActiveCell.Value = ActiveCell.Value + 1 End If End With End Sub 3. Make sure there is only ONE fullstop in the line .Select ctm "Excel Noob" wrote in message ... It keeps saying the ..Select thing is a syntax error. It's highlighted in blue and the Sub Button1_Click() line is highlighted yellow. It also sometimes says error: expected:case. "Corey" wrote: 1. Place a Forms Button on the worksheet 2. It will prompt you to set a macro to it 3. Selecte the NEW option 4. Between the Sub Button1_Click() and the End Sub place the code With Sheet1 ..Select If activecell.value <"" then Activecell.value = Activecell.value + 1 end if end with Will look like: Sub Button1_Click() With Sheet1 ' Does the following with the Sheet selected ..Select ' Selects the Sheet above If activecell.value <"" then ' Check to see if the Cell that is selected has No Value in it, if No Value then doe the following Activecell.value = Activecell.value + 1 ' Changes the value of the ActiveCell to ADD 1 to the value end if ' End of the IF statement (If ActiveCell is empty) end with ' End of the With Statement (Sheet) ' Ends the SUB Routine End Sub Corey.... "Excel Noob" wrote in message ... I cannot get the macro to work. I can't say I'm really a macro expert. I tried it using m as the form button, but it wouldn't work. If it's not too much trouble, could someone explain the process? Microsoft Help didn't really get it done for me... "Corey" wrote: Or you could try: Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#10
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thanks!!
"Corey" wrote: Sorry, might be my fault with the 2 x fullstops in the SELECT line. There is ONLY one. "Corey" wrote in message ... 1. Make sure the Button name is correct, i used Button1, but this need not be the case if you have more than 1 already 2. If you right click the button and select Asign Macro the code between the grey lines should have: Sub Button1_Click() With Sheet1 ..Select If ActiveCell.Value < "" Then ActiveCell.Value = ActiveCell.Value + 1 End If End With End Sub 3. Make sure there is only ONE fullstop in the line .Select ctm "Excel Noob" wrote in message ... It keeps saying the ..Select thing is a syntax error. It's highlighted in blue and the Sub Button1_Click() line is highlighted yellow. It also sometimes says error: expected:case. "Corey" wrote: 1. Place a Forms Button on the worksheet 2. It will prompt you to set a macro to it 3. Selecte the NEW option 4. Between the Sub Button1_Click() and the End Sub place the code With Sheet1 ..Select If activecell.value <"" then Activecell.value = Activecell.value + 1 end if end with Will look like: Sub Button1_Click() With Sheet1 ' Does the following with the Sheet selected ..Select ' Selects the Sheet above If activecell.value <"" then ' Check to see if the Cell that is selected has No Value in it, if No Value then doe the following Activecell.value = Activecell.value + 1 ' Changes the value of the ActiveCell to ADD 1 to the value end if ' End of the IF statement (If ActiveCell is empty) end with ' End of the With Statement (Sheet) ' Ends the SUB Routine End Sub Corey.... "Excel Noob" wrote in message ... I cannot get the macro to work. I can't say I'm really a macro expert. I tried it using m as the form button, but it wouldn't work. If it's not too much trouble, could someone explain the process? Microsoft Help didn't really get it done for me... "Corey" wrote: Or you could try: Sub Button1_Click() With Sheet1 ..Select If activecell.Value < "" Then activecell.Value = activecell.Value + 1 End If End With End Sub which will add (1) to the cell that is selected whent he forms button is pressed. Corey.... "Corey" wrote in message ... Yes, Sub Button1_Click() With Sheet1 ' Changer to suit ..Select If Range("A1").Value < "" Then ' Change A1 to suit Range("A1").Value = Range("A1").Value + 1 End If End With End Sub Corey.... "Excel Noob" wrote in message ... Is there a way, via a macro or some such, that I could add one to the value of a cell by pushing a button or something, rather than having to manually change the value? |
#11
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Assuming the cell simply contains a number
Highlight the cell. Press [F2] enter +1 press [Home] press equal [=] or plus [+] press [Enter] If the cell contains a formula, or if you have already done the above once: Highlight the cell. Press [F2] enter +1 press [Enter] ________ Greg Stigers, MCSA remember to vote for the answers you like |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I copy a value from a cell and paste it into another cell while adding it to the previous value in that cell | Excel Worksheet Functions | |||
adding a formul to the next cell only with the next cell number | Excel Discussion (Misc queries) | |||
Adding numbers in one cell and showing total in seperate cell | Excel Discussion (Misc queries) | |||
Adding the same cell in different worksheets. Can that cell be variable? | Excel Worksheet Functions | |||
adding a formula in a cell but when cell = 0 cell is blank | Excel Worksheet Functions |