Hi - I would like to pass worksheet names through multiple subs, but I'm not sure the best way to do this. I would like to say that w1=Sheet1, w2 = Sheet2 and be able to use w1, w2 through all subs. Below is an example. Thanks!!
Code:
Dim w1 as Worksheet, w2 as Worksheet
Sub RunAllSubs()
Test
Code
Hmmm
End Sub
Sub Test()
w1.visible = true
w2.visible = true
End Test
Sub Code()
w2.UsedRange.Copy Destination:=w1.Columns(1)
End Sub
Sub Hmmm()
RowNumber = w2.cells(Rows.Count,"A").End(xlUp).Row
End Sub
Last edited by a moderator: