Hy,
My target is to fill the cells in column B with a formula from the first empty cell for the last used row.
I can fill the cells from a given cell until last used row with this code:
And I can find the firts empty cell in a row:
But how can I combine this two?
(the first and a last used cell is change often so it's not acceptable to set a constant cell address in the code)
Thanks!
My target is to fill the cells in column B with a formula from the first empty cell for the last used row.
I can fill the cells from a given cell until last used row with this code:
Code:
Dim Lastrow As Long
Lastrow = .Range("A" & Rows.Count).End(xlUp).Row
With shBom
'other parts of the macro
.Range("C2:C" & Lastrow).FillDown
End With
And I can find the firts empty cell in a row:
Code:
Dim Firstrow As Range
Set Firstrow = shMySheet.Range("B1").End(xlDown).Offset(1, 0)
'other parts of the macro
But how can I combine this two?
(the first and a last used cell is change often so it's not acceptable to set a constant cell address in the code)
Thanks!