Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sheet names in VBE
In the project explorer, if your entries look like
A (Sheet1) B (Sheet2) C (Sheet3) so that A, B and C are the codenames of the sheet. Sub AAAABB() Dim VC As Object Dim i As Long Dim varr(1 To 3) i = 0 For Each VC In ThisWorkbook.VBProject.VBComponents If VC.Type = vbext_ct_Document Then Select Case LCase(VC.Name) Case "a", "b", "c" i = i + 1 varr(i) = VC.Properties("Name").Value If i = 3 Then Exit For End Select End If Next Worksheets(varr).Select Worksheets(varr(1)).Activate End Sub -- Regards, Tom Ogilvy Steve wrote in message news:3fac1008$0$14371$afc38c87@... Hi. I have the following code: Sheets(Array("Sheet1", "Sheet2", "Sheet3")).Select Sheets("Sheet1").Activate I have named my sheets in the VBE to A, B and C. How do I rewrite the above code using the VBE names? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sheet Referencing - autofilling sheet names | Excel Worksheet Functions | |||
Cell names = sheet names | Excel Worksheet Functions | |||
Add Names of First Sheet and Automatically Add to Second Sheet | Excel Discussion (Misc queries) | |||
sheet names | Excel Discussion (Misc queries) | |||
I want to print out the sheet tabs (sheet names) | Excel Worksheet Functions |