Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Beginner at vba.
Get error at line: GroupIt = "B3:E" + LastRow Example of what I am trying to do: say last row is 36 this time around, so GroupIt would = B3:E36 What code can perform this correctly? Sub SortGroup() Dim GroupIt As Range Dim LastRow As Long If WorksheetFunction.CountA(Cells) 0 Then 'Search for any entry, by searching backwards by Rows. LastRow = Cells.Find(What:="*", After:=[A1], _ SearchOrder:=xlByRows, _ SearchDirection:=xlPrevious).Row 'MsgBox LastRow End If GroupIt = "B3:E" + LastRow Range(GroupIt).Select Selection.Sort Key1:=ActiveCell, Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom ' , DataOption1:=xlSortNormal End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help! I am having a problem with sort! | Excel Discussion (Misc queries) | |||
formula to sort a range so that it matches the exact rows of a column that is outside that range? | Excel Discussion (Misc queries) | |||
Sort range changes during sort | Excel Discussion (Misc queries) | |||
Sort Problem | Excel Programming | |||
sort problem | Excel Programming |