Hello!
I tried to automate a stupid work that I am doing in Excel right now: Copying names down into the cells below that are empty. The problem is that the loop doesn't really work, it only jumps between cells C2 and C3 - anybody knows what I did wrong? Your help would be very much appreciated!! Cheers, Fabian
Sub fab99()
'
' fab99 Macro
' Macro recorded 2005/02/01 by Fabian WYSS
'
'
Dim i As Integer
Dim k As Integer
i = 2
k = 3
Do
Cells(i, k).Select
If Cells(i, k).Value = "" Then
Cells(i, k).Value = Cells(i - 1, k).Value
Cells(i + 1, k).Select
Else: Cells(i + 1, k).Select
End If
Loop Until i = 400
End Sub
I tried to automate a stupid work that I am doing in Excel right now: Copying names down into the cells below that are empty. The problem is that the loop doesn't really work, it only jumps between cells C2 and C3 - anybody knows what I did wrong? Your help would be very much appreciated!! Cheers, Fabian
Sub fab99()
'
' fab99 Macro
' Macro recorded 2005/02/01 by Fabian WYSS
'
'
Dim i As Integer
Dim k As Integer
i = 2
k = 3
Do
Cells(i, k).Select
If Cells(i, k).Value = "" Then
Cells(i, k).Value = Cells(i - 1, k).Value
Cells(i + 1, k).Select
Else: Cells(i + 1, k).Select
End If
Loop Until i = 400
End Sub