Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello-
How would you refernce sheet names in a if/then statement? I need to look at different ranges based on the sheet name, here is my code below: If Sheet.Name = "Jan 08" Then Range("A4:Z74").Select Selection.Sort Key1:=Range("Z4"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A1:B1").Select Else If Sheet.Name = "Feb 08" Then Range("A4:Y74").Select Selection.Sort Key1:=Range("Y4"), Order1:=xlDescending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A1:B1").Select End If End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using IF to refernce another cell | Excel Programming | |||
Cell names = sheet names | Excel Worksheet Functions | |||
Circular Refernce | Excel Discussion (Misc queries) | |||
Using Sheet names & Workbook names in VBA coding | Excel Programming | |||
return all worksheet tab names and chart sheet tab names in report - an example | Excel Programming |