I am looking to create a dynamic range that I can manipulate in VBA for sorting purposes. I have the following code:
I would then put my sorting code after the selection. How can I make the above work where x is the last cell with a value in it from A2 down.
VBA Code:
Dim x As Range
x = Sheet1.Range("A2").End(xlDown)
Sheet1.Range("A2:" & x).Select
I would then put my sorting code after the selection. How can I make the above work where x is the last cell with a value in it from A2 down.