![]() |
Activating a Worksheet?
WorkbookA has a worksheet with a column of cells listing the names of
worksheets in WorkbookB. How can I activate the worksheet in B that matches the active cell on the list in WorkbookA? |
Activating a Worksheet?
Kenny,
Run this when WorkbookA is active, with the sheet with the names active, and the selection made: Sub ActivateSheet() Dim myShName As String myShName = Selection(1).Value Workbooks("WorkbookB.xls").Activate Worksheets(myShName).Activate End Sub HTH, Bernie MS Excel MVP "Kenny R" wrote in message ... WorkbookA has a worksheet with a column of cells listing the names of worksheets in WorkbookB. How can I activate the worksheet in B that matches the active cell on the list in WorkbookA? |
Activating a Worksheet?
Thank You very much---worked great...Kenny
"Bernie Deitrick" wrote: Kenny, Run this when WorkbookA is active, with the sheet with the names active, and the selection made: Sub ActivateSheet() Dim myShName As String myShName = Selection(1).Value Workbooks("WorkbookB.xls").Activate Worksheets(myShName).Activate End Sub HTH, Bernie MS Excel MVP "Kenny R" wrote in message ... WorkbookA has a worksheet with a column of cells listing the names of worksheets in WorkbookB. How can I activate the worksheet in B that matches the active cell on the list in WorkbookA? |
Activating a Worksheet?
Kenny,
You're quite welcome... glad to hear that you got it to work. Bernie MS Excel MVP "Kenny R" wrote in message ... Thank You very much---worked great...Kenny "Bernie Deitrick" wrote: Kenny, Run this when WorkbookA is active, with the sheet with the names active, and the selection made: Sub ActivateSheet() Dim myShName As String myShName = Selection(1).Value Workbooks("WorkbookB.xls").Activate Worksheets(myShName).Activate End Sub HTH, Bernie MS Excel MVP "Kenny R" wrote in message ... WorkbookA has a worksheet with a column of cells listing the names of worksheets in WorkbookB. How can I activate the worksheet in B that matches the active cell on the list in WorkbookA? |
All times are GMT +1. The time now is 10:28 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com