Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can to make a macro specific to one sheet in a workbook? I am using Office
2003 and the simple macro is shown below. There are multiple sheets in the workbook and if you accidently run this marco when you have one of the other sheets in the active window it really messes things up. I want the macro to be able to effect only one sheet. In the script is selects a range Range("A2:P32").Select Can you add something like Range ("sheetname!a2:P32").Select so it will only go to the named sheet? If this is possible I need the syntax for the command. Sub Wins() ' ' Wins Macro ' Macro recorded 12/6/2007 by jh ' ' Keyboard Shortcut: Ctrl+w ' Range("A2:P32").Select ActiveWindow.SmallScroll Down:=-9 Selection.Sort Key1:=Range("N3"), Order1:=xlDescending, Key2:=Range("A3") _ , Order2:=xlAscending, Header:=xlYes, OrderCustom:=1, MatchCase:=False _ , Orientation:=xlTopToBottom Range("A2").Select End Sub TIA Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run Macro When Specific Sheet Selected | Excel Programming | |||
macro to send excel sheet to specific email address | Excel Programming | |||
make a macro to move specific rows to another sheet | Excel Worksheet Functions | |||
Need Macro to copy specific sheet | Excel Worksheet Functions | |||
How copy specific range from one sheet to another using a Macro (V | Excel Programming |