LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default declaring public variables

Hi there

The following is most bizarre!

In my VBA project I've declared several public variables as normal (ahead of
all procedures) ... Public ctrNegInv, ctrPosInv As Integer, etc.

I set the values in one procedure and then execute a second procedure but,
when the variable is encountered in the second procedure, it appears to be
empty and I get a "Subscript out of range" error.

For instance, if I hover the cursor over the variable in the variable
declarations section, it says ctrNegInv = Empty, whereas if I hover the
cursor in the procedure where I set it's value it says ctrNegInv=0, and
further if I hover the cursover in the subsidiary or later procedures I get
ctrNegInv = Empty.

Can I be going mad?

Best regards
Loane



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Declaring variables in Module vs. Public Jeff Excel Discussion (Misc queries) 5 November 19th 07 08:27 PM
Declaring Variables Public ob3ron02[_9_] Excel Programming 1 October 25th 04 06:11 PM
Declaring Variables Public ob3ron02[_8_] Excel Programming 1 October 25th 04 02:14 PM
declaring a public array JT[_2_] Excel Programming 3 July 27th 04 11:18 PM
Declaring Public Procedure mac Excel Programming 3 December 3rd 03 05:01 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"