Hi All,
I'm trying to make a command which automatically inserts a row into the pictured sheet below with formulas in each cell, and I'm not quite sure how to have the command input the right cell reference into the formulas; I want it to reference a cell in the active cell's row and a specific column.
For instance, the formula in cell A4 is: =ROW(A4)-(1+COUNTBLANK(OFFSET(A4,ROW($A$1)-ROW(A4),0):OFFSET(A4,-1,0))), which calculates the number of the line item, not including the top row or any header rows.
When I hit the "insert row" command button with the current active cell somewhere in row 4, I'd want it to create a new row with that formula in A4, and if the active cell were in row 5 I'd want the A4 references to be A5.
I'm rather new to VBA so I apologize if this is trivial to accomplish and I'm just missing something, thank you!
I'm trying to make a command which automatically inserts a row into the pictured sheet below with formulas in each cell, and I'm not quite sure how to have the command input the right cell reference into the formulas; I want it to reference a cell in the active cell's row and a specific column.
For instance, the formula in cell A4 is: =ROW(A4)-(1+COUNTBLANK(OFFSET(A4,ROW($A$1)-ROW(A4),0):OFFSET(A4,-1,0))), which calculates the number of the line item, not including the top row or any header rows.
When I hit the "insert row" command button with the current active cell somewhere in row 4, I'd want it to create a new row with that formula in A4, and if the active cell were in row 5 I'd want the A4 references to be A5.
I'm rather new to VBA so I apologize if this is trivial to accomplish and I'm just missing something, thank you!