counting 1 - 2 - 4 - 8 - 16 - 32

alaric

Registered User.
Local time
Today, 16:26
Joined
Sep 6, 2004
Messages
50
Hi,

I want to build my counter to count like above number sequence?
doubling the previous value

how to do this in vba?

any hint or tips

thx in advance
Al
 
Last edited:
alaric,

Code:
Dim i As Long
Dim j As Long
For i = 0 to 20
   j = 2 ^ i
   Next i

Wayne
 
and this vba code

give you all the numbers

Code:
Dim i As Long
Dim j As String

For i = 1 To 20
   j = j & "," & 2 ^ i
   Next i
j = Right(j, Len(j) - 1)
MsgBox j
 

Users who are viewing this thread

Back
Top Bottom