jerry12302
Active Member
- Joined
- Apr 18, 2005
- Messages
- 449
- Office Version
- 2010
- Platform
- Windows
I have a range named GoToLink in Sheet2 that contains a cell reference, currently "Annual Revenues"!C5
I want the macro to go to the referenced sheet, "Annual Revenues", and select the cell C5.
I have tried many examples that I have found on the web, here and elsewhere, that do not work, even though the person asking replied that it worked. I'm using Windows 7 and Office 2010.
I've tried to simplify it by using code I found that just selects the sheet based on another cell. In Sheet2 C6 contains the sheet name, "Annual Revenues" (including the quotes).
Sub SelectCell
ThisWorkbook.Sheets(Worksheets("Sheet2").Range("C6").Value).Activate
End Sub
I get the error "Subscript out of range".
If I were to hard code the sheet and cell reference it would look like this, which works of course...
Sub SelectCell
Sheets("Annual Revenues").Select
Range("C5").Select
End Sub
How do I substitute the sheet name and cell reference using my range GoToLink which contains "Annual Revenues"!C5 ?
I want the macro to go to the referenced sheet, "Annual Revenues", and select the cell C5.
I have tried many examples that I have found on the web, here and elsewhere, that do not work, even though the person asking replied that it worked. I'm using Windows 7 and Office 2010.
I've tried to simplify it by using code I found that just selects the sheet based on another cell. In Sheet2 C6 contains the sheet name, "Annual Revenues" (including the quotes).
Sub SelectCell
ThisWorkbook.Sheets(Worksheets("Sheet2").Range("C6").Value).Activate
End Sub
I get the error "Subscript out of range".
If I were to hard code the sheet and cell reference it would look like this, which works of course...
Sub SelectCell
Sheets("Annual Revenues").Select
Range("C5").Select
End Sub
How do I substitute the sheet name and cell reference using my range GoToLink which contains "Annual Revenues"!C5 ?