Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am trying to use a macro to sort a table of data on worksheet 3, whenever I
update a value on worksheet 1 using Excel 2003 (Copy of macro below). Although the macro picks up the change in data on sheet 1 and runs the sort subroutine, nothing happens. I have discovered that by moving the tables to sheet 1 and repointing the macro to the data that it does work and while this is sufficient, I would like to know why the macro does not work when the tables are on sheet 3. Thank you for any advice anyone can provide Private Sub Worksheet_Change(ByVal Target As Range) If Not (Application.Intersect(Worksheets(1).Range("B4:U32 "), Target) Is Nothing) Then DoSort End If End Sub Private Sub DoSort() Worksheets(3).Range("A5:I10").Sort Key1:=Worksheets(3).Range("I5"), Order1:=xlDescending, _ Key2:=Worksheets(3).Range("H5"), Order2:=xlDescending, Header:=xlYes Worksheets(3).Range("A13:I18").Sort Key1:=Worksheets(3).Range("I13"), Order1:=xlDescending, _ Key2:=Worksheets(3).Range("H13"), Order2:=xlDescending, Header:=xlYes Worksheets(3).Range("A21:I27").Sort Key1:=Worksheets(3).Range("I21"), Order1:=xlDescending, _ Key2:=Worksheets(3).Range("H21"), Order2:=xlDescending, Header:=xlYes Worksheets(3).Range("A30:I36").Sort Key1:=Worksheets(3).Range("I30"), Order1:=xlDescending, _ Key2:=Worksheets(3).Range("H30"), Order2:=xlDescending, Header:=xlYes End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to Auto sort or save a sort? | Excel Discussion (Misc queries) | |||
Auto-Sort Won't Sort All Column Cells | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Auto Sort using Macro | Excel Worksheet Functions | |||
Help:macro to auto sort data to different worksheets... | Excel Discussion (Misc queries) |