Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following macro to sort a range of cells :-
Range("A2:J5").Select Range("J2").Activate Selection.Sort Key1:=Range("J2"), Key2:=Range("I2"), Key3:=Range("G2"), Order1:=xlDescending, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom That works fine when attahced to a button, bit I wanted it to work automatically when I update a second sheet that drives formulas on the original sheet. I'm using the "Private Sub worksheet_Calculate()" event to drive it, but using the same code as above gives me a Range selection error. Anyone any ideas how to get round this? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I combine MACROS and functions? | New Users to Excel | |||
macros with functions | Excel Worksheet Functions | |||
excel functions in macros | Excel Programming | |||
VBA, Macros, functions, or formulas | Excel Programming | |||
Macros and IF Functions | Excel Programming |