Hi all,
I try to select a variable range of cells in a column, in order to sort the data alphabetically.
This code does the job allright:
However, if the data in the column doesn't reach up to row 999, why select that deep? Is there a possibility to select only rows with data in them. Something like this:
This works fine, too. Can both lines be somehow combined?
Thanks for responses!!
Patrick.
I try to select a variable range of cells in a column, in order to sort the data alphabetically.
This code does the job allright:
VBA Code:
ws.Sort.SortFields.Add2 Key:=Range("A3:A999"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal 'Group (A-Z)
VBA Code:
Range("D3", Selection.End(xlDown)).Style = "Percent"
Thanks for responses!!
Patrick.