Increment by one.

C

Colin Hayes

Hi

I suspect this is simple ....

I have an integer in C6.

I want to run a macro at the end of which this integer is increased by
1.

Can anyone supply the line of code which will do this?


Best Wishes
Drno
 
J

Jason Morin

Sub Incrementby1()
Dim rng As Range
Set rng = Sheets("Sheet1").Range("C6")
rng.Value = rng.Value + 1
End Sub
 
C

Colin Hayes

Jason Morin said:
Sub Incrementby1()
Dim rng As Range
Set rng = Sheets("Sheet1").Range("C6")
rng.Value = rng.Value + 1
End Sub

Hi Jason

Thanks for getting back. It worked perfectly first time.

Thanks again

Drno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top