Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with VBA code not running in Excel 2003
Hi All,
I have recently developed a sheet which checks the distance between 2 postcodes and then outputs results to another sheet and sorts them by distance (closest to furthest). This works perfectly in Excel 2007 (which I developed the sheet with) but when my collegue runs it in 2003 the code for the sort fails. The code is: Range(Selection, Selection.End(xlDown)).Select ActiveWorkbook.Worksheets("Agencies by Distance").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Agencies by Distance").Sort.SortFields.Add Key:=Range("F7"), _ SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Agencies by Distance").Sort .SetRange Range("A7:H1000") .Header = xlNo .MatchCase = False .Orientation = xlTopToBottom .SortMethod = xlPinYin .Apply End With It fails on the second line of code and I don't know why? Can anyone shed any light on this for me. many thanks Stephen Muir |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
problem running code | Excel Programming | |||
Problem running VBA 2000 code in Excel 2003 | Excel Programming | |||
XL 2003: Problem running Solver from VBA | Excel Programming | |||
Problem Running Code in Excel 2003 | Excel Programming | |||
Problem running code behind a userform | Excel Programming |