Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Initialisation

Status
Not open for further replies.

vestax22

Programmer
Jun 18, 2003
139
CA
Hi, I'm working with Excel 2000 VBA

I have a sub which initialises many doubles. All it does is set 10 variables to 0. I was wondering if it was possible to initialise them to 0 in one or two lines.

I know that in c++ you could do something like this :

temp = temp2 = temp3 = 0

This would initialise all three variables to 0

If someone could answer this question I have the same problem with a bunch of strings that I would like to initialise as "". Thx in advance for the help.


 
Hi,

In VBA you don’t have to initialize variable to zero, Boolean to false and string to an empty string. The compilator does it for you.


Jean-Paul
Montreal
jp@solutionsvba.com
mtljp2@sympatico.ca
 
hmm

I'm afraid that in my case I have to. If I don't I get garbage results. I tried. So is there a way?

Thx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top