PDA

View Full Version : Solved: Increase value of a Cell by 1



alu
08-21-2009, 01:38 AM
Hi,

I would like to create a button that when pressed increases the vale of an adjacent cell by +1.

Currently I am using a macro that silently puts the existing value in another location applies =sum(cell + cell A1 //which contains the value 1) then copies it back.

This seems a very messy way of doing it. Does anyone have a cleaner simpler suggestion?

Thanks in advance all

Alu

edit: maybe a macro that will just run this formula '=sum(cell+1)'

Bob Phillips
08-21-2009, 01:42 AM
Public Sub AddOne()
With Activecell

.Value = .Value + 1
End With

alu
08-21-2009, 01:50 AM
Thanks El Cid,

I keep getting a compile error tho?

'Expected End Sub'

alu
08-21-2009, 01:51 AM
D'oh! needed an End Sub in there!

thanks again!