Hello VBA team. I think this do-able, I'm just missing a nuance I think.
I have a column of data (invoice numbers), which is interspersed randomly with empty or null values. The empty cells will ultimately will get invoice numbers after research.
I would like to loop through the column, simply replacing any empty or null value with "TempInvoiceNo1", "TempInvoiceNo2", and so on.
I thought the code below would work, but no cigar:
Sub PasteTemporaryInv()
Last = Cells(Row.Count, "G").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "G").Value) Is Null Then
Cells(i, "G").Value = "TempInvoiceNo" & "i"
End If
Next i
End Sub
Conceptually, I think I need to find the last row in the column with a value and then work upwards to the top of the column.
When I try this code, I get VBA error code '424' and "object required". Honestly, I don't know what object VBA is looking for. Maybe I am missing some dimensions?
Thanks in advance for any help here, or a better way to do this. Would prefer a looping solution, but will take anything I can get.
I have a column of data (invoice numbers), which is interspersed randomly with empty or null values. The empty cells will ultimately will get invoice numbers after research.
I would like to loop through the column, simply replacing any empty or null value with "TempInvoiceNo1", "TempInvoiceNo2", and so on.
I thought the code below would work, but no cigar:
Sub PasteTemporaryInv()
Last = Cells(Row.Count, "G").End(xlUp).Row
For i = Last To 1 Step -1
If (Cells(i, "G").Value) Is Null Then
Cells(i, "G").Value = "TempInvoiceNo" & "i"
End If
Next i
End Sub
Conceptually, I think I need to find the last row in the column with a value and then work upwards to the top of the column.
When I try this code, I get VBA error code '424' and "object required". Honestly, I don't know what object VBA is looking for. Maybe I am missing some dimensions?
Thanks in advance for any help here, or a better way to do this. Would prefer a looping solution, but will take anything I can get.