I have the below code in macro... under the key range ("a1:a4162).. which meand during the record of my macro my data is up to 4162.
i need this to chnage if i populate my sheet with data with 5000
Range("A1").Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("Incident Ticket").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Incident Ticket").AutoFilter.Sort.SortFields.Add _
Key:=Range("A1:A4162"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Incident Ticket").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
i need this to chnage if i populate my sheet with data with 5000
Range("A1").Select
Selection.AutoFilter
ActiveWorkbook.Worksheets("Incident Ticket").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Incident Ticket").AutoFilter.Sort.SortFields.Add _
Key:=Range("A1:A4162"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Incident Ticket").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With