Variables

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Why do my variable seem to not be global? I have two subs:

Sub A()
Static CountRows As Long
CountRows = 1
MsgBox (CountRows)
End Sub

This one shows that CountRows = 1

Sub Bt()
Static CountRows As Long
MsgBox (CountRows)
End Sub

But when I run this one it does not remember CountRows = 1, and resets it to
zero. Why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top