Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Makelei explained on 6/1/2010 :
Hi, XP and Excel2003. What might be the reason why this is not working (Sheet2 is codename): Sheet2.Select I have tried all possibilities that I can imaging, but no. I have another file and selecting sheet with code name (Sheet4.Select) funtions just fine. Now using code: Workbooks.Open Filename:=Doc2 ActiveWorkbook.Sheet2.Select Opens Doc2 excel file just fine, but does not open the sheet. Thanks in advance MakeLei Here's a reusable function I use that returns the Worksheet.Name from any workbook given its Worksheet.CodeName. Function Get_SheetTabName(CodeName As String, Optional Wkb As Workbook) As String Dim Wks As Worksheet If Wkb Is Nothing Then Set Wkb = ActiveWorkbook For Each Wks In Wkb.Worksheets If Wks.CodeName = CodeName Then _ Get_SheetTabName = Wks.Name: Exit Function Next End Function regards, -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Selecting Sheet By Codename | Excel Programming | |||
Hide sheet via codename | Excel Programming | |||
change sheet codename | Excel Programming | |||
Selecting a sheet by codename | Excel Programming | |||
Using sheet codename problems | Excel Programming |