Roger Govier
12/14/2006 2:14:00 PM
Hi Keri
Yes, declare the variable after Option Explicit and before the first of
your Subs.
The gl doesn't make it global it is just a convention used by many to
show that this is a global variable utilised by many routines.
In your case, Answer is the number of pages, and if the question hasn't
been asked, then the value will be 0 from the original dim statement so
I don't think you need to worry about setting a Boolean as to whether
you have answered.
Just change your loops to
If answer >0 Then
For p =1 to answer
. rest of your code here
.
End If
--
Regards
Roger Govier
"keri" <keri.dowson@diageo.com> wrote in message
news:1166103670.589282.64140@16g2000cwy.googlegroups.com...
> Sorry i'm new to Excel and my knowledge is tiny.
>
> I'm guessing you mean to declare the variable where it says Option
> Explicit.
> Does the gl refer to it being a global variable?
>
> How and where would I put the othere variable to show true/false if it
> has been answered already? And once I had this second variable would I
> have to refer to it with an If statement,
>
> eg currently my second use of answer says;
>
> For p = 1 to answer
>
> Would it have to be
> For p = 1 to answer if bla is true?
>
> How would I word this?
>