I’m working on excel that contain thousands of data.
I wish to be able to copy value from cells in column D, If cells in column B is empty.
Here is the code that I’ve tried, but it didn’t give any results i expected.
Any idea of how to achieve this? Thank you very much!
Sub kopikopi()
Dim lngRow As Long
Dim BotRow As Long
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ThisWorkbook
Set ws = wb.Sheets("2024")
BotRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
For lngRow = 1 To BotRow
If Cells(lngRow, "B") <> vbNullString Then
Cells(lngRow, "B") = Cells(lngRow, "D")
End If
Next lngRow
End Sub
2