Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I was using the macro recorder to see how to use the range.sort
function. When I did, I got something like: Range("A1:J235").Sort Key1:=Range("A1"), Order1:=xlAscending I should always know the number of columns but the number of rows will vary. What's the best in code of coming up the "A1:J235"? Thanks, Woody |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
lastrow=Cells(rows.count,"A").end(xlup).row Range("A1:J" & lastrow).Sort Key1:=Range("A1"), Order1:=xlAscending HTH "sugargenius" wrote: I was using the macro recorder to see how to use the range.sort function. When I did, I got something like: Range("A1:J235").Sort Key1:=Range("A1"), Order1:=xlAscending I should always know the number of columns but the number of rows will vary. What's the best in code of coming up the "A1:J235"? Thanks, Woody |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks, I forgot you can concatenate strings and numbers without any
effort. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formulas that reference cells that reference another cell | Excel Discussion (Misc queries) | |||
Compare two cells from reference cells | Excel Worksheet Functions | |||
best way to get reference to all used cells | Excel Worksheet Functions | |||
How do I reference the last 3 cells in a row as cells are added | Excel Worksheet Functions |