Hi there,
I would to ask for a little help with learning how to change my row values to a variable while i was trying to customise/write this VBA code (from recorded macro) to suit my needs.
here is the
i am trying to change the selection part form N2:N189 to N2:NxlDown (so that it selcts however many row are present later on). How can i do that?
Thanks in advance!
I would to ask for a little help with learning how to change my row values to a variable while i was trying to customise/write this VBA code (from recorded macro) to suit my needs.
here is the
Rich (BB code):
Sub Macro2()
Range("A1").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
ActiveWorkbook.Worksheets("Summary").AutoFilter.Sort.SortFields.Clear
'now sorting for Levles from 4 to 1
ActiveWorkbook.Worksheets("Summary").AutoFilter.Sort.SortFields.Add Key:= _
Range("N2:N189" & xlDown??), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption _
:=xlSortNormal
'now sorting for Responsible Parties
ActiveWorkbook.Worksheets("Summary").AutoFilter.Sort.SortFields.Add Key:= _
Range("T2:T189" & xlDown??), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Summary").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A1").Select
End Sub
i am trying to change the selection part form N2:N189 to N2:NxlDown (so that it selcts however many row are present later on). How can i do that?
Thanks in advance!