Thread: VB Sum n+1
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default VB Sum n+1


For i = 2 To n
Cells(i,"A").Formula = "=A" & i-1
Next i

but it is not clear how to determine what n is, or how to calculate it (the
xx in yhour example).

--

HTH

RP
(remove nothere from the email address if mailing direct)


"herve" wrote in
message ...

Hello all.
could someone help me to do the following in a Macro.

In cell A1, I have Number "1"

I want to have :
A2 = A1 + 1
A3 = A2 + 1
A4 = A3 + 1
....
Axx = Axx-1 + 1

Thanks in advance

Herve


--
herve
------------------------------------------------------------------------
herve's Profile:

http://www.excelforum.com/member.php...o&userid=27314
View this thread: http://www.excelforum.com/showthread...hreadid=482037