keithmcvean
New Member
- Joined
- Dec 20, 2013
- Messages
- 13
I have a macro tied to a button on a sheet called "Programs". As part of the code of this it sorts a named range "Setting_Employees" on a separate sheet called "Settings".
Ideally, to keep the macro from flipping around the active sheets I was hoping to sort a non-selected, non-active sheet. So far I haven't been able to make this work.
This code works but, as I said, I was hoping to do this without making the Settings sheet active. Is it possible?
Worksheets("Settings").Select
Range("Setting_Employees").Sort Key1:=Range("Setting_Employees").Cells(1, 1), _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
Thanks in advance,
Keith
Ideally, to keep the macro from flipping around the active sheets I was hoping to sort a non-selected, non-active sheet. So far I haven't been able to make this work.
This code works but, as I said, I was hoping to do this without making the Settings sheet active. Is it possible?
Worksheets("Settings").Select
Range("Setting_Employees").Sort Key1:=Range("Setting_Employees").Cells(1, 1), _
Header:=xlNo, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, DataOption1:=xlSortNormal
Thanks in advance,
Keith