sooty8
02-05-2013, 02:50 AM
Hi All
Recorded the Macro below if I insert a row manually into the sheet do I have to open the macro and change the range or can it find the new range automatically.
Sub Macro1()
'Macro1 Macro
Range("A1:H17").Select
ActiveWorkbook.Worksheets(" February 2013").Sort.SortFields.Clear
ActiveWorkbook.Worksheets(" February 2013").Sort.SortFields.Add Key:=Range( "A2:A17"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets(" February 2013").Sort
.SetRange
Range("A1:H17")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Many Thanks For Any Help
Regards
Sooty8
Recorded the Macro below if I insert a row manually into the sheet do I have to open the macro and change the range or can it find the new range automatically.
Sub Macro1()
'Macro1 Macro
Range("A1:H17").Select
ActiveWorkbook.Worksheets(" February 2013").Sort.SortFields.Clear
ActiveWorkbook.Worksheets(" February 2013").Sort.SortFields.Add Key:=Range( "A2:A17"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets(" February 2013").Sort
.SetRange
Range("A1:H17")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Many Thanks For Any Help
Regards
Sooty8