View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ian[_4_] Ian[_4_] is offline
external usenet poster
 
Posts: 85
Default "Sort" macro in late bound code

I'm having trouble converting a macro to late bound code so I can run it in
Access. I recorded the macro in Excel and got the following code

Columns("A:C").Select
Selection.Sort Key1:=Range("C2"), Order1:=xlDescending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom

So far, I've been able to get rid of the xl... references by converting them
to their equivalent numbers and have the following code

..Columns("A:C").Select
..Selection.Sort Key1:=Range("C2"), Order1:=2, Header:=1, _
OrderCustom:=1, MatchCase:=False, Orientation:=1

The problem I have is that when the code runs, Range is highlighted with the
error Sub or Function not defined. What do I need to replace this with?

Ian