M
MCheru
I would like to create a macro that will search every cell in column K. When
a blank cell is found in Column K, I want the macro to copy the contents in
the cell above it and paste those contents in each blank cell in Column K
going down until the next cell with contents is reached. I’ve been working
with this code but unsuccessfully. It was originally intended for a range of
columns.
Sub FillBlankRows()
Dim BlankCell As Integer
Dim r As Long
Dim col As Long
For r = 3 To 100
For col = 11 to 11
If Cells(r, col).Value = "" Then
BlankCell = BlankCell + 1
End If
Next
If BlankCell = 11 Then
Range("K" & r - 1 & ":K" & r - 1).Copy Range("K" & r)
End If
BlankCell = 0
Next
End Sub
a blank cell is found in Column K, I want the macro to copy the contents in
the cell above it and paste those contents in each blank cell in Column K
going down until the next cell with contents is reached. I’ve been working
with this code but unsuccessfully. It was originally intended for a range of
columns.
Sub FillBlankRows()
Dim BlankCell As Integer
Dim r As Long
Dim col As Long
For r = 3 To 100
For col = 11 to 11
If Cells(r, col).Value = "" Then
BlankCell = BlankCell + 1
End If
Next
If BlankCell = 11 Then
Range("K" & r - 1 & ":K" & r - 1).Copy Range("K" & r)
End If
BlankCell = 0
Next
End Sub