I have a macro that I'm running which sorts column 'C' (contents are surnames) into alphabetical order, including keeping the data in the same row with the sorted name. for instance, Column B is Date, Column C is name, D, E, F - AB etc has data related to the Name and Date in B and C
Question:
When I use the macro to 'Sort Name' alphabetically, the data is sorted but there are a number of empty rows left above the sorted data, without any data in other columns of the same row.
Is there any way these blank rows can be at the bottom of the list?
The contents of column C 'Name' contains a formula to bring the name forward from the previous month, ie Formula in cells -> =IF(Aug!C128=0,"",Aug!C128)
Might the empty rows being placed at the top of the column be because of formular / data brought forward from the previous month, perhaps?
I appreciate any help with this issue. Many thanks
PurrSent %
Macro being used to 'Sort Name'
Question:
When I use the macro to 'Sort Name' alphabetically, the data is sorted but there are a number of empty rows left above the sorted data, without any data in other columns of the same row.
Is there any way these blank rows can be at the bottom of the list?
The contents of column C 'Name' contains a formula to bring the name forward from the previous month, ie Formula in cells -> =IF(Aug!C128=0,"",Aug!C128)
Might the empty rows being placed at the top of the column be because of formular / data brought forward from the previous month, perhaps?
I appreciate any help with this issue. Many thanks
PurrSent %
Macro being used to 'Sort Name'
VBA Code:
Sub SortName()
'
' Sort Name Column 'C' - A-Z
ActiveSheet.Unprotect
' Range("B24").Select
' ActiveWindow.SmallScroll Down:=50
Range("B24:AB218").Select
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add Key:=Range("C24:C218"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveSheet.Sort
.SetRange Range("B24:AB218")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("C26").Select
End Sub