This is, in fact, related to, and follows on from, a previous post - https://www.mrexcel.com/forum/excel-questions/1095651-macro-sort-column-range-alphabetically-taking-rows-them.html
Summary
I have recorded a Macro to sort a column (C) within Range("B24:AF218") to sort Column 'C' alphabetically. I'm very grateful for help from acinDean who has helped me get this far.
And now ...
I could really do with some help, please, with adjusting this Macro so that it can be used on any 'active sheet', and not only March (which is the sheet I recorded on) I have sheets Jan thru to Dec. I have looked and looked at this code to try to work out how to adjust it but it's way beyond my capabilities
Also, using this Macro, column 'C' is sorted alphabetically BUT, where there is data, ie 'x' or '0' in 'B' alongside an empty cell in 'C', this row is sorted to the top of the section instead of, preferably, at the lower end of the sorted list.
Many thanks to anyone who can help me with this issue. I'll be very grateful
Summary
I have recorded a Macro to sort a column (C) within Range("B24:AF218") to sort Column 'C' alphabetically. I'm very grateful for help from acinDean who has helped me get this far.
Code:
Range("B24:AF218")
Sub Macro4()
'
' Macro4 Macro
' Sort Name Colume 'C' - A-Z
'
'
Sheets("Mar").Select
ActiveSheet.Unprotect
Range("B24").Select
ActiveWindow.SmallScroll Down:=50
Range("B24:AB100").Select
ActiveWorkbook.Worksheets("Mar").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Mar").Sort.SortFields.Add Key:=Range("C24:C100"), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Mar").Sort
.SetRange Range("B24:AB100")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Sheets("Mar").Select
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
Range("C26").Select
End Sub
And now ...
I could really do with some help, please, with adjusting this Macro so that it can be used on any 'active sheet', and not only March (which is the sheet I recorded on) I have sheets Jan thru to Dec. I have looked and looked at this code to try to work out how to adjust it but it's way beyond my capabilities
Also, using this Macro, column 'C' is sorted alphabetically BUT, where there is data, ie 'x' or '0' in 'B' alongside an empty cell in 'C', this row is sorted to the top of the section instead of, preferably, at the lower end of the sorted list.
Many thanks to anyone who can help me with this issue. I'll be very grateful