VB/Excel Find first empty cell ina column
Hi there!
Hope you can help me.
I have column "A" with 6000 rows containing data.
A1 to A6000.
But not all rows contains data. Some are empty.
Now i want a code that goes from first row to row 6000 and fill the empty cells with a value from an another cell in the row.
For example
A1=3
A2=4
A3=15
A4 is blank. In a4 i want the value from d4-e4.
Hope you understand.
Thanks Sverker
Re: VB/Excel Find first empty cell ina column
Thread moved to Office Development/VBA forum (note that the "VB Editor" in Office programs is actually VBA rather than VB, so the VB6 forum is not really apt)
Re: VB/Excel Find first empty cell ina column
This is not the fastest way but it is easy for you to understand:
Code:
Sub xx()
Dim r As Long
For r = 1 To 6000
If Cells(r, 1) = "" Then
Cells(r, 1) = Cells(r, 4) - Cells(r, 5)
End If
Next
End Sub