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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Declaring a public array

Status
Not open for further replies.

eargo

Programmer
Jan 3, 2003
12
GB
Hiya, how do you declare a public array? exactly? I can find no code snippets - and when I try:
public dim colorarray(1 To 15) As Long

I get an error. I've tried it inside a public function, and inside the calling cmd_button - and outside - still no joy. Basically, I want to be able to access the array from 1 Sub and 3 functions.

Thanks

Yum.
 
Leave the "dim" out. "public" implies you're dimensioning.
Rob
[flowerface]
 
what exactly do I put, and where, I'm just getting errors when I declare it outside the subs or modules, and errors if I declare it inside.
 
Be sure to put the declaration at the top of your module, before any subs or functions. If you still get errors, please tell us which ones.
Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top