I need to sort an entire worksheet going from Columns A to J, and from Rows 2 to n. "n" is a variable that represents a number that will change from time to time.
For now, let's just say that n=10. But it can be anything like 12, 14, 20, 100, etc. It will change every time.
I can't just use Range("A2:J10"), because it will not always be J10. It might be J12, J14, J20, J100, etc. I can't use Range("A2:Jn").Sort, because it doesn't recognize "n" as a number there. There is no such thing as Range.(Cells(2,1):Cells(10,n)).Sort
What else can I use besides the Range property to select an entire range of cells?
Range("A2:J_").Sort Key1:=Columns("A")
Bookmarks