Hi. I have a problem which are my cell wrongly copy data. It supposed to copy really next cell, but it copy the data below next cell. This is the example,
when column "L" is blank or empty, then it will copy next cell in column M.
<tbody>
</tbody>
<tbody>
</tbody>
it supposed to be like this,
<tbody>
</tbody>
<tbody>
</tbody>
but my output is like this,
it copy cell from below cell in 5.
<tbody>
</tbody>
<tbody>
</tbody>
this is my code,
Thanks in advance
when column "L" is blank or empty, then it will copy next cell in column M.
column L | column M |
1 | |
2 | |
3 | 3 |
<tbody>
</tbody>
4 | |
5 | |
6 | |
3 | 7 |
<tbody>
</tbody>
it supposed to be like this,
column L | column M |
1 | 1 |
2 | 2 |
3 | 3 |
<tbody>
</tbody>
4 | 4 |
5 | 5 |
6 | 6 |
3 | 7 |
<tbody>
</tbody>
but my output is like this,
it copy cell from below cell in 5.
column L | column M |
2 | 1 |
3 | 2 |
3 | 3 |
<tbody>
</tbody>
5 | 4 |
6 | 5 |
7 | 6 |
3 | 7 |
<tbody>
</tbody>
this is my code,
Code:
Sub BlankNcopy()
Dim R As Range, Rblank As Range, c As Range
Set R = Range("L2", Cells(Rows.Count, "L").End(xlUp))
On Error Resume Next
Set Rblank = R.SpecialCells(xlCellTypeBlanks)
If Rblank Is Nothing Then
MsgBox "No blank cells in col L)"
Exit Sub
End If
Application.ScreenUpdating = False
For Each c In R.SpecialCells(xlCellTypeBlanks)
c.Value = c.Offset(1, 1).Value
Next c
Application.ScreenUpdating = True
End Sub
Thanks in advance