Hello
I am trying to define a range using the sheets assignment like below
I get an error. what am I missing?![]()
Public Sub TEST() sh = Sheet1.Cells(4, 3).Value Set rngChart = Sheets(sh).Range(Cells(8, 1), Cells(209, 44)) End Sub
Thanks
Hello
I am trying to define a range using the sheets assignment like below
I get an error. what am I missing?![]()
Public Sub TEST() sh = Sheet1.Cells(4, 3).Value Set rngChart = Sheets(sh).Range(Cells(8, 1), Cells(209, 44)) End Sub
Thanks
![]()
Option Explicit Public Sub TEST() Dim sh, rngChart As Range sh = Sheet1.Cells(4, 3).Value Set rngChart = Sheets(sh).Range(Cells(8, 1), Cells(209, 44)) End Sub
thank you, I guess I messed that
Should not the "Cells" have the sheet defined?
or![]()
Public Sub TEST() Dim sh, rngChart As Range sh = Sheet1.Cells(4, 3).Value Set rngChart = Sheets(sh).Range(Sheets(sh).Cells(8, 1), Sheets(sh).Cells(209, 44)) End Sub
![]()
Public Sub TEST() Dim sh, rngChart As Range sh = Sheet1.Cells(4, 3).Value With Sheets(sh) Set rngChart = .Range(.Cells(8, 1), .Cells(209, 44)) End With End Sub
If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved
Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown
Btw, this appears to have been cross-posted here
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks