CtJester7807
New Member
- Joined
- Mar 11, 2020
- Messages
- 6
- Office Version
- 2019
Hi All,
I've been trying to solve this for a few days now. I am relatively new to VBA, and I am running into trouble due to the data in my worksheets being dynamic.
I need to autofill a formula down to the last row of the adjacent column next to it. The problem I'm running into, is I'm not sure what to title my range, as it wont always be column D for example. I'm aware I can just copy my formula to the bottom of the page, but I would like to keep it cleaner than that. I have been using ActiveCell to drive my steps since I can't rely on any hard coded cells.
What do I need to put in my range, so it selects everything below my active cell down to the last cell of the adjacent column (the column to the left). I also know offset will be used here.
The below is what I have so far.
Cells.Find("Average").Select
Selection.EntireColumn.Offset(0, 1).Insert Shift:=xlToLeft
Selection.End(xlUp).Offset(0, 1).Activate
ActiveCell.Value = "ABS"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=ABS(RC[-1])"
ActiveCell.Range().FillDown
Thank you!
I've been trying to solve this for a few days now. I am relatively new to VBA, and I am running into trouble due to the data in my worksheets being dynamic.
I need to autofill a formula down to the last row of the adjacent column next to it. The problem I'm running into, is I'm not sure what to title my range, as it wont always be column D for example. I'm aware I can just copy my formula to the bottom of the page, but I would like to keep it cleaner than that. I have been using ActiveCell to drive my steps since I can't rely on any hard coded cells.
What do I need to put in my range, so it selects everything below my active cell down to the last cell of the adjacent column (the column to the left). I also know offset will be used here.
The below is what I have so far.
Cells.Find("Average").Select
Selection.EntireColumn.Offset(0, 1).Insert Shift:=xlToLeft
Selection.End(xlUp).Offset(0, 1).Activate
ActiveCell.Value = "ABS"
ActiveCell.Offset(1, 0).Select
ActiveCell.FormulaR1C1 = "=ABS(RC[-1])"
ActiveCell.Range().FillDown
Thank you!