A
andym
Dear All,
could somebody please help me in regards to what I am doing wrong?
I have a worksheet_change event that when a cell value is changed it
runs some code to update some tables on another worksheet (the calc
sheet).
However, if I am actually in the other (calc) sheet (which is not my
intention) then my code works fine. But because I don't want to
physically move (or activate or select) this calc sheet I am having
problems correctly referencing my code.
The code is sitting in a module of the Workbook, not in a specific
worksheet.
I get a "Select Method of Range Class failed" message in the below
code...
Sub doCalcs()
Dim ws As Worksheet
Dim rStart As Range
Dim tStart As Range
Dim tTeam As Range
Set ws = ThisWorkbook.Sheets("Calcs")
Set rStart = ws.Range("B4")
Set tStart = ws.Range("E4")
Set tTeam = ws.Range("J4")
rStart.select 'this is where I am getting the error...
.....more code
End Sub
What do I need to select the cell "B4" is selected in the "Calcs"
sheet?
many thanks,
andym
could somebody please help me in regards to what I am doing wrong?
I have a worksheet_change event that when a cell value is changed it
runs some code to update some tables on another worksheet (the calc
sheet).
However, if I am actually in the other (calc) sheet (which is not my
intention) then my code works fine. But because I don't want to
physically move (or activate or select) this calc sheet I am having
problems correctly referencing my code.
The code is sitting in a module of the Workbook, not in a specific
worksheet.
I get a "Select Method of Range Class failed" message in the below
code...
Sub doCalcs()
Dim ws As Worksheet
Dim rStart As Range
Dim tStart As Range
Dim tTeam As Range
Set ws = ThisWorkbook.Sheets("Calcs")
Set rStart = ws.Range("B4")
Set tStart = ws.Range("E4")
Set tTeam = ws.Range("J4")
rStart.select 'this is where I am getting the error...
.....more code
End Sub
What do I need to select the cell "B4" is selected in the "Calcs"
sheet?
many thanks,
andym