ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need help with using VBA to select tabs in Excel (https://www.excelbanter.com/excel-programming/367751-need-help-using-vba-select-tabs-excel.html)

MFINE

Need help with using VBA to select tabs in Excel
 
I am trying to create a loop in VBA which will insert into a sheets().select
statement the name of the tab I am interested in. The tab names would be
contained in a tab in the same workbook. Any suggestions?

Thanks

Die_Another_Day

Need help with using VBA to select tabs in Excel
 
Sub LoopSheetsFromRange()
Dim NameRange as Range
Dim ShName as Range
Sheets("Sheet1").Select 'Assumes Sheet1 Holds Sheet Names
Set NameRange = Range("A1:A10") 'Assumes A1:A10 are all valid Sheet
Names
For each ShName in NameRange
Sheets(ShName.Value).Select
Next
End Sub

HTH

Die_Another_Day
MFINE wrote:
I am trying to create a loop in VBA which will insert into a sheets().select
statement the name of the tab I am interested in. The tab names would be
contained in a tab in the same workbook. Any suggestions?

Thanks




All times are GMT +1. The time now is 01:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com