Thread: Is there away?
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Michael Koerner Michael Koerner is offline
external usenet poster
 
Posts: 164
Default Is there away?

Thanks, will try it out.

--

Regards
Michael Koerner


"Mike H" wrote in message ...
Hi,

lastrow = Cells(Rows.Count, "G").End(xlUp).Row
Range("A1:G" & lastrow).Sort Key1:=Range("E2")

Mike

"Michael Koerner" wrote:

I have a macro with the following line:

Range("A1:G1024").Sort Key1:=Range("E2"),

Is there a way to code it so that whenever I add a new item I don't have to continually edit the macro, and change the end range value to accommodate the newly inserted item?

--

Regards
Michael Koerner