Hi,
I am having problems retrieving a range of cells from another worksheet.
The following ignores the With/End With and uses the range on the current sheet.
The following produces a runtime error - Unable to get the Select Property of the Worksheet class
Any help would greatly be appreciated.
Thanks,
I am having problems retrieving a range of cells from another worksheet.
The following ignores the With/End With and uses the range on the current sheet.
Code:
Private Sub Worksheet_Activate()
EnableEvents = True
Call BuildMilestoneTasks
MDRows = Sheets("Survey Definitions").Cells(Rows.Count, 1).End(xlUp).Row
MDColumns = Sheets("Survey Definitions").Cells(3, Columns.Count).End(xlToLeft).Column
With Sheets("Survey Definitions")
TmpArray = Range(Cells(5, 1), Cells(MDRows, MDColumns))
End With
Call BuildStatus
Application.Goto Range("A1:A1"), scroll:=False
EnableEvents = False
End Sub
Code:
Private Sub Worksheet_Activate()
EnableEvents = True
Call BuildMilestoneTasks
MDRows = Sheets("Survey Definitions").Cells(Rows.Count, 1).End(xlUp).Row
MDColumns = Sheets("Survey Definitions").Cells(3, Columns.Count).End(xlToLeft).Column
With Sheets("Survey Definitions").Select
TmpArray = Range(Cells(5, 1), Cells(MDRows, MDColumns))
End With
Call BuildStatus
Application.Goto Range("A1:A1"), scroll:=False
EnableEvents = False
End Sub
Thanks,