Hi all,
As you can see here ( https://docs.google.com/spreadsheet/...1E&pli=1#gid=0 ), I have a spreadsheet that was filtered manually, and now I want to apply some VBA code I made, only to the filtered rows, presented in the link. How can I do this?
By the way, the code goes like this (the range present on the code is an old one, I want to change that for the filtered rows on the previous link):
Sub SortRows()
Dim RgToSort As Range
Dim RgRow As Range
Application.ScreenUpdating = False
Set RgToSort = Range(Range("B1:C42"), Range("B1:C42").End(xlDown))
For Each RgRow In RgToSort.Rows
RgRow.Sort Key1:=Range(RgRow.Item(1).Address), Order1:=xlAscending, Orientation:=xlLeftToRight, OrderCustom:=1
Next
Application.ScreenUpdating = True
End Sub
Thanks in advance,
Joćo Fernandes
Bookmarks