Hello,
I've been racking my brain with this one for far too long and decided to finally ask for help.
I have a report that will be extracted everyday but the number of rows and colums will never be the same, although the last 3 columns and the bottom row will always be needed. I need to start on cell E2 and then...
Shift ->End->Right
Shift ->Left x 3
Shift ->End->Down
Shift ->Up x 1
If I can do this successfully then I will capture the correct range of cells that I need every time regardless of the rows or columns and the last 3 colums and the bottom row will be left alone.
When I try to do this by recording a macro (below), it always logs the selection as a range e.g. Range("E2:AA2").Select but this will be incorrect if I run it the next day and the columns/rows have all changed.
Is there a way to make these moves in the same manner (or better) without hardcoding specific cells into the macro?
I'll appreciate any help on this one,
Thanks in advance.
I've been racking my brain with this one for far too long and decided to finally ask for help.
I have a report that will be extracted everyday but the number of rows and colums will never be the same, although the last 3 columns and the bottom row will always be needed. I need to start on cell E2 and then...
Shift ->End->Right
Shift ->Left x 3
Shift ->End->Down
Shift ->Up x 1
If I can do this successfully then I will capture the correct range of cells that I need every time regardless of the rows or columns and the last 3 colums and the bottom row will be left alone.
When I try to do this by recording a macro (below), it always logs the selection as a range e.g. Range("E2:AA2").Select but this will be incorrect if I run it the next day and the columns/rows have all changed.
VBA Code:
Sub M_1()
'
' M_1 Macro
'
'
Range(Selection, Selection.End(xlToRight)).Select
Range("E2:AA2").Select
Range(Selection, Selection.End(xlDown)).Select
Range("E2:AA33").Select
End Sub
Is there a way to make these moves in the same manner (or better) without hardcoding specific cells into the macro?
I'll appreciate any help on this one,
Thanks in advance.