Greetings,
I have a fairly large macro (one that I cannot share). However I think I know the direction I need to go, but not quite sure of the method.
we have defined the below,
Dim ExcelWorksheet As String
and use it like this:
ExcelWorksheet = "Tab1"
This works as expected, but I would like the macros to function on other tabs. Is there a way to have the ExcelWorksheet = "Tab1" function on the active worksheet?
Thaanks,
Brad
Assist with defining worksheet
-
- 4StarLounger
- Posts: 545
- Joined: 30 Mar 2010, 18:49
- Location: United States
-
- Administrator
- Posts: 78631
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 4StarLounger
- Posts: 545
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Assist with defining worksheet
That did it! I knew it had "activeSheet", just not the rest...
Thanks,
Brad
Thanks,
Brad
-
- 4StarLounger
- Posts: 588
- Joined: 14 Nov 2012, 16:06
Re: Assist with defining worksheet
Refrain from using a variable and use activesheet anywhere you want to refer to the activeSheet.
Why using a variable for a variable Object reference?
PS. I never saw a macro that can't be shared.
Why using a variable for a variable Object reference?
PS. I never saw a macro that can't be shared.
-
- 2StarLounger
- Posts: 151
- Joined: 11 Jun 2012, 20:37
Re: Assist with defining worksheet
re 'PS. I never saw a macro that can't be shared.'
Well, you never would, would you? unless you wrote it yourself!
Well, you never would, would you? unless you wrote it yourself!
-
- 4StarLounger
- Posts: 588
- Joined: 14 Nov 2012, 16:06
Re: Assist with defining worksheet
Not even then.