ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   some simple (?) simulation (https://www.excelbanter.com/excel-programming/417256-some-simple-simulation.html)

LesioB1

some simple (?) simulation
 
Hi,
do some know how to simulate in VBA operation known in C as ++i, it's
mean add to the same variable

The Best

Lesio

Per Jessen

some simple (?) simulation
 
Hi

Maybe i = i + 1 ?

Regards,
Per

"LesioB1" skrev i meddelelsen
...
Hi,
do some know how to simulate in VBA operation known in C as ++i, it's mean
add to the same variable

The Best

Lesio



Nigel[_2_]

some simple (?) simulation
 
There is no direct equivalent, but just use

i =i+1

2 extra characters

--

Regards,
Nigel




"LesioB1" wrote in message
...
Hi,
do some know how to simulate in VBA operation known in C as ++i, it's mean
add to the same variable

The Best

Lesio



Mike H

some simple (?) simulation
 
Perhaps

i = i + i

Mike

"LesioB1" wrote:

Hi,
do some know how to simulate in VBA operation known in C as ++i, it's
mean add to the same variable

The Best

Lesio


LesioB1

some simple (?) simulation
 
Per Jessen pisze:
Hi

Maybe i = i + 1 ?

Regards,
Per

"LesioB1" skrev i meddelelsen
...
Hi,
do some know how to simulate in VBA operation known in C as ++i, it's
mean add to the same variable

The Best

Lesio



Per
in above (describe by you) case you get implade on recurrence call and
this is the point.

LesioB1

RB Smissaert

some simple (?) simulation
 
Not sure what the purpose of your idea is, but how about:

Sub PlusPlus(lVar As Long)
lVar = lVar + 1
End Sub

Sub test()

Dim i As Long

PlusPlus i
MsgBox i

End Sub


RBS


"LesioB1" wrote in message
...
Hi,
do some know how to simulate in VBA operation known in C as ++i, it's mean
add to the same variable

The Best

Lesio



LesioB1

some simple (?) simulation
 


HI
ok I try to explain in more details:
The case is: in cell A1 there is value. In the next cell B1 I try
insert function which check this value and if the condition is True try
to increase it by 1 ( if A1 < X then ++A1). There is some kind of counter
Excel complain about recurrency.

regards
LesioB1

RB Smissaert pisze:
Not sure what the purpose of your idea is, but how about:

Sub PlusPlus(lVar As Long)
lVar = lVar + 1
End Sub

Sub test()

Dim i As Long

PlusPlus i
MsgBox i

End Sub


RBS


"LesioB1" wrote in message
...
Hi,
do some know how to simulate in VBA operation known in C as ++i, it's
mean add to the same variable

The Best

Lesio




All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com