![]() |
Button to add 1 to selected cell
Hi Groupies:
I would like to create a macro that allows me to add the value of 1 to the content of any cell that I select. For example: If I select a10,b12,c23 and d45, I would like to click on a button and have their current content increase by 1. I think this needs to be done in VBA code, but I am not sure what to do or how to start ...........something like x=x+1..... Any ideas or suggestions? Thanks |
Button to add 1 to selected cell
how about
for each c in selection c.value=c+1 next -- Don Guillett SalesAid Software "CJ" wrote in message ... Hi Groupies: I would like to create a macro that allows me to add the value of 1 to the content of any cell that I select. For example: If I select a10,b12,c23 and d45, I would like to click on a button and have their current content increase by 1. I think this needs to be done in VBA code, but I am not sure what to do or how to start ...........something like x=x+1..... Any ideas or suggestions? Thanks |
Button to add 1 to selected cell
Hi Don:
That is exactly what I wanted. I'm not sure if I went about it properly, I pretended to record a macro, stopped recording and then edited to add your text. Thanks a bunch! CJ "Don Guillett" wrote: how about for each c in selection c.value=c+1 next -- Don Guillett SalesAid Software "CJ" wrote in message ... Hi Groupies: I would like to create a macro that allows me to add the value of 1 to the content of any cell that I select. For example: If I select a10,b12,c23 and d45, I would like to click on a button and have their current content increase by 1. I think this needs to be done in VBA code, but I am not sure what to do or how to start ...........something like x=x+1..... Any ideas or suggestions? Thanks |
Button to add 1 to selected cell
Sure, here it is:
Sub Increase1() ' ' Increase1 Macro ' Macro recorded 3/30/2006 ' For Each C In Selection C.Value = C + 1 Next ' End Sub CJ "Don Guillett" wrote: glad it helped. Perhaps you should post your final for the archives -- Don Guillett SalesAid Software "CJ" wrote in message ... Hi Don: That is exactly what I wanted. I'm not sure if I went about it properly, I pretended to record a macro, stopped recording and then edited to add your text. Thanks a bunch! CJ "Don Guillett" wrote: how about for each c in selection c.value=c+1 next -- Don Guillett SalesAid Software "CJ" wrote in message ... Hi Groupies: I would like to create a macro that allows me to add the value of 1 to the content of any cell that I select. For example: If I select a10,b12,c23 and d45, I would like to click on a button and have their current content increase by 1. I think this needs to be done in VBA code, but I am not sure what to do or how to start ...........something like x=x+1..... Any ideas or suggestions? Thanks |
All times are GMT +1. The time now is 07:23 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com