jufglanville
New Member
- Joined
- Sep 11, 2017
- Messages
- 23
I'm sure this is quite a simple question. I want to find a way to use the UsedRange function in conjunction with a loop.
Currently I am using the following code but I am having to manually input the value in Z to the bottom of the table. How do I replace this with the UsedRange function? I'm not able to go to the first cell that contains a blank as many cells within the range do!
Private Sub MergeDates2()
Dim i As Long
i = 1
Do While Cells(i, "Z").Value <> ""
If IsEmpty(Cells(i, "A")) = True Then
Cells(i, "A").Value = Cells(i, "C")
End If
i = i + 1
Loop
End Sub
Currently I am using the following code but I am having to manually input the value in Z to the bottom of the table. How do I replace this with the UsedRange function? I'm not able to go to the first cell that contains a blank as many cells within the range do!
Private Sub MergeDates2()
Dim i As Long
i = 1
Do While Cells(i, "Z").Value <> ""
If IsEmpty(Cells(i, "A")) = True Then
Cells(i, "A").Value = Cells(i, "C")
End If
i = i + 1
Loop
End Sub