|
-
Apr 27th, 2006, 11:59 AM
#1
Thread Starter
Junior Member
Excel Macro Variable Scope problem
Hi
Ive code some code:
Option Explicit
Sub Macro1()
DIm Count As Integer
Dim verticalcounter As Integer
'ActiveSheet.Select
ThisWorkbook.Worksheets(downloadsheetname).Select
'do lots of stuff
Call findaccount
End Sub
Sub findaccount()
ThisWorkbook.Worksheets(accountmappingsheetname).Select
'do some stuff
End Sub
Problem:
VB editor highlights accountmappingsheetname and says:
"variable not defined"
I know this is due to scope deceleration of the variable. I have tried declaring it as Public and Global but when i do decleration gets highlighted and error given:
"Invalid attribute in sub or function"
Please help, my boss is about to poo all over me
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|