Forum Discussion
dfuhrman840
Sep 19, 2022Copper Contributor
Excel formula or VBA script
I have an excel spreadsheet that I am doing grouping by rows function, then Subtotal function based off of invoice numbers (column A). In the total rows, I am needing more information carried down fr...
- Sep 19, 2022
Alternatively: select G1:J57.
Press Ctrl+G or F5 to activate the Go To dialog.
Click Special...
Select Blanks.
Click OK.
G3 should now be the active cell in the selection.
Enter the formula =G2 and press Ctrl+Enter to propagate the formula to all blank cells in the selection.
OliverScheurich
Sep 19, 2022Gold Contributor
Sub fill()
Dim i As Long
Dim j As Long
j = Range("F" & Rows.Count).End(xlUp).Row
For i = 1 To j
If Cells(i, 7).Value = "" Then
Range(Cells(i, 7), Cells(i, 10)).Value = Range(Cells(i - 1, 7), Cells(i - 1, 10)).Value
Else
End If
Next i
End SubYou can try these lines of code. In the attached file you can click the button in cell L2 to run the macro.
- dfuhrman840Sep 19, 2022Copper Contributor
OliverScheurich - Thank you! I will try this out.