Increment a variable

  • Thread starter Thread starter Neil
  • Start date Start date
N

Neil

Hi, is there a tidy or quick way to write the following,
mynewarraycounter = mynewarraycounter + 1 ?
 
Hi Neil
VBA does not support something like
mynewarraycounter++

so your approach is the correct one
 
Unfortunately not. Other languages I've used have some great ones( x +
1, x++, etc.). It is a pain, but you'll get used to it. - Piku
 
Other languages I've used have some great ones

Well, that is C/C++, some others?
 
That's from Java actually:-)
I mean, it's from C/C++ to, but I know it from Java.
I don't think I'm quite ready for the big boys yet. Soon though.
x += 1 is from Perl. I'm having alot of fun with that one!
- Piku
 
Found this on www.mrexcel.com It works great. Excel will do increment on open

In the Workbook module (Or, if it’s a Userform, in the Initialize event of that Userform) put the following

Private Sub Workbook_Open(
Sheet1.Range("A1") = Sheet1.Range("A1") +
End Su

By Juan Pablo Gonzalez on 25-May-2002
 

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

Back
Top