Hello,
Im looking for VBA to input a formula into a cell based on the cell value next to it. If the Cell value next to it is blank it shall stop.
I have the below which loops and stops when a blank cell is found, but I need it to perform an action.
The action would be the below lookup which populates in the next blank row, column L.
So this lookup should go into Column L where there is data present in H, if no data is present it should stop putting the lookup in.
Thanks!
Im looking for VBA to input a formula into a cell based on the cell value next to it. If the Cell value next to it is blank it shall stop.
I have the below which loops and stops when a blank cell is found, but I need it to perform an action.
Code:
Sub DoWhile_Loop()
Dim BlankFound As Boolean
Dim x As Long
'Loop until a blank cell is found in Column A
Do While BlankFound = False
x = x + 1
If Cells(x, "A").Value = "" Then
BlankFound = True
End If
Loop
'Report out first blank cell found in Column A
MsgBox "Cell A" & x & " is blank!"
End Sub
The action would be the below lookup which populates in the next blank row, column L.
Code:
Mainbook.Sheets("People Value Tracker").Cells(Rows.Count, 12).End(xlUp).Offset(1, 0) = "=IFERROR(VLOOKUP(RC[3],'Tab 1'!C[-10]:C[-4],6,0),"""")"
So this lookup should go into Column L where there is data present in H, if no data is present it should stop putting the lookup in.
Thanks!