I want to pass the names of sheets and ranges between subroutines. The following throws a "Subscript out of range" error:
Sub This()
x = "Sheet1"
y = "D3"
MsgBox (x.Range(y).Value)
End Sub
This is a sample of my Project Explorer.
I want to pass the names of sheets and ranges between subroutines. The following throws a "Subscript out of range" error:
Sub This()
x = "Sheet1"
y = "D3"
MsgBox (x.Range(y).Value)
End Sub
This is a sample of my Project Explorer.
Your worksheet's .Name property is Valuation; its Worksheet .CodeName property is Sheet1.