As long as Lib is declared only in one module as a Public variable, you
should be able use it from any other procedure in any module. Make sure you
are not declaring it anywhere else. Also, "Lib" is a reserved word in VB
(used with the Declare statement). I would rename the variable to avoid
confusion.
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)
"J@Y" <(E-Mail Removed)> wrote in message
news:B12B77B5-9B30-4AF8-93FA-(E-Mail Removed)...
>I declared a public variable "Lib" in Module1. I have a For loop in Module
>1
> using "Lib" :
>
> For Lib = 1to 10
>
> ...(code) ...
>
> Next
>
> In the (code) section, I call Module2. When Module2 calls the Lib
> variable,
> gives me the ambiguous variable error. Is this because the For statement
> actually declares Lib as a procedural variable instead of using it as a
> public variable?