Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Apologies for the simple question, but I can't find the answer by
searching the net. In PHP you can increment a variable by 1 thus: $var++; In some forms of BASIC it's: var +=1 How do you incremenet a variable by 1 in VBA other than: iVar = iVar + 1 Is there simpler way? Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sskulkrinbait,
The normal method would be that shown by you: iVar = iVar + 1 --- Regards, Norman wrote in message oups.com... Apologies for the simple question, but I can't find the answer by searching the net. In PHP you can increment a variable by 1 thus: $var++; In some forms of BASIC it's: var +=1 How do you incremenet a variable by 1 in VBA other than: iVar = iVar + 1 Is there simpler way? Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
iVar = iVar + 1 doesn't seem particularly onerous to me but another way is a
For - Next loop where the variable is increased by 1 when the next is executed. " wrote: Apologies for the simple question, but I can't find the answer by searching the net. In PHP you can increment a variable by 1 thus: $var++; In some forms of BASIC it's: var +=1 How do you incremenet a variable by 1 in VBA other than: iVar = iVar + 1 Is there simpler way? Thanks. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 27, 10:10 am, Mike H wrote:
iVar = iVar + 1 doesn't seem particularly onerous to me but another way is a For - Next loop where the variable is increased by 1 when the next is executed. " wrote: Apologies for the simple question, but I can't find the answer by searching the net. In PHP you can increment a variable by 1 thus: $var++; In some forms of BASIC it's: var +=1 How do you incremenet a variable by 1 in VBA other than: iVar = iVar + 1 Is there simpler way? Thanks.- Hide quoted text - - Show quoted text - Thanks, I was wondering as some of my variable names are quite long so if you could do it using var ++ or something it would save me a second or two each time, I must be getting lazy. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Sskulkrinbait,
'----------------- Thanks, I was wondering as some of my variable names are quite long so if you could do it using var ++ or something it would save me a second or two each time, I must be getting lazy. '----------------- You could autocomplete the long variable name using Ctrl_Shift ... --- Regards, Norman |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was wondering as some of my variable names are quite long so
Hi. This is in my Library of routines. I shortened the name to "Inc" to represent the "Increment" function. Function Inc(ByRef n) '// Increment by +1 n = n + 1 End Function Sub Test() Dim ALongVariableName ALongVariableName = 6 Inc ALongVariableName End Sub -- HTH :) Dana DeLouis Windows XP & Office 2007 wrote in message ups.com... On Apr 27, 10:10 am, Mike H wrote: iVar = iVar + 1 doesn't seem particularly onerous to me but another way is a For - Next loop where the variable is increased by 1 when the next is executed. " wrote: Apologies for the simple question, but I can't find the answer by searching the net. In PHP you can increment a variable by 1 thus: $var++; In some forms of BASIC it's: var +=1 How do you incremenet a variable by 1 in VBA other than: iVar = iVar + 1 Is there simpler way? Thanks.- Hide quoted text - - Show quoted text - Thanks, I was wondering as some of my variable names are quite long so if you could do it using var ++ or something it would save me a second or two each time, I must be getting lazy. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
incrementing | Excel Discussion (Misc queries) | |||
Variable Incrementing | Excel Discussion (Misc queries) | |||
Next not incrementing | Excel Programming | |||
Incrementing Variable shortcut | Excel Programming | |||
Increment variable not incrementing? | Excel Programming |