Apologies for double posting, but I've two different errors within the same macro. I've been trying to activate a particular worksheet just to practice using the following code:
Sub activateSheet()
'activates sheet of specific name
Dim sheetname As String
Worksheets(sheetname).Activate
End Sub
I keep getting the error message 'Runtime error 9: Subscript Out of Range' even though there's definitely a sheet called 'sheetname' within my workbook. Any reason as to why this might be happening?
Sub activateSheet()
'activates sheet of specific name
Dim sheetname As String
Worksheets(sheetname).Activate
End Sub
I keep getting the error message 'Runtime error 9: Subscript Out of Range' even though there's definitely a sheet called 'sheetname' within my workbook. Any reason as to why this might be happening?