Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
I want to sort information in columns a to columns f the I need this to be
done by macro the problem is when I have a new person come in to the place i would have to rewrite the code. is the any way at all to have a macro count the rows start from row 3. Thanks in advance Greg |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
I want to sort information in (columns a : columns f) I need this to be done by macro. The problem I am having is when I have a new person come in to the place i would have to rewrite the code. Is there any way at all to have a macro count the rows, starting from row 3. Thanks in advance Greg |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
In say cell Z1 of the sheet, enter the formula; =65534-COUNTIF(A3:A65536,"") Them in your macro, do the following; Range("A3:I" & Range ("Z1").value)+2).Select Selection.Sort Key1:=Range("A3"), Order1:=xlAscending Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom _ DataOption1:=xlSortNormal I don't think there's a way of counting in VB itself. This is th method I've always used. Hope this helps, Da -- dspence ----------------------------------------------------------------------- dspencer's Profile: http://www.excelforum.com/member.php...fo&userid=3096 View this thread: http://www.excelforum.com/showthread.php?threadid=50633 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Sorting
Thanks will give it a go
Greg "dspencer" wrote in message ... In say cell Z1 of the sheet, enter the formula; =65534-COUNTIF(A3:A65536,"") Them in your macro, do the following; Range("A3:I" & Range ("Z1").value)+2).Select Selection.Sort Key1:=Range("A3"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal I don't think there's a way of counting in VB itself. This is the method I've always used. Hope this helps, Dan -- dspencer ------------------------------------------------------------------------ dspencer's Profile: http://www.excelforum.com/member.php...o&userid=30967 View this thread: http://www.excelforum.com/showthread...hreadid=506333 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting Values Without Sorting Formulas | Excel Discussion (Misc queries) | |||
Automatic sorting (giving max and min) based on custom sorting lis | Excel Worksheet Functions | |||
Sorting VLookup vs Sorting SumProduct | Excel Discussion (Misc queries) | |||
Sorting: Sorting by the First Character | Excel Discussion (Misc queries) | |||
Sorting ListBox results or transposing ListBox values to other cells for sorting | Excel Programming |