Hello, I have been working on trying to identify the solution to this for the past day with little success. Any assistance or guidance would be greatly appreciated.
I am copying data from one sheet (sheet A) and pasting into another sheet (sheet B). I can find the cell I need to paste the information into in Sheet B and am able to paste that information just fine. Once I paste the data to Column B in Sheet A, I find the last value in Column A and offset by 1 to go to the first empty cell as you can see in the code. At which time I add Today's date. What I am struggling with is autofilling the formula down to the last used cell in the adjacent column. I have found other posts that describe how to autofill down in a specific range (A1:A500 for example), but I am struggling with how to do it with a dynamic range.
Thanks in advance for any ideas.
I am copying data from one sheet (sheet A) and pasting into another sheet (sheet B). I can find the cell I need to paste the information into in Sheet B and am able to paste that information just fine. Once I paste the data to Column B in Sheet A, I find the last value in Column A and offset by 1 to go to the first empty cell as you can see in the code. At which time I add Today's date. What I am struggling with is autofilling the formula down to the last used cell in the adjacent column. I have found other posts that describe how to autofill down in a specific range (A1:A500 for example), but I am struggling with how to do it with a dynamic range.
Code:
Sub QBFindLastRow()
'Paste data into last open cell in column "B" for OrderID
'Add today's date to the next available empty cell in Column A and autofill down to last used cell in Column B
'Copy all the cells that were autofilled down and paste back as a value because the date needs to remain static since this is done each day
Windows("1_b_MasterAllProductsUPCPID_Oracle_PC.xlsm").Activate
Range("B1048576").End(xlUp).Offset(1).Select
ActiveSheet.Paste
Range("A1048576").End(xlUp).Offset(1).Select
ActiveCell.FormulaR1C1 = "=TODAY()"
ActiveCell.copy
End Sub
Thanks in advance for any ideas.