
Originally Posted by
mohd9876
please try this code
Dim r As Range
Dim res As Range
Set r = Range("B3", Range("E" & Rows.Count).End(xlUp))
Set res = r.Find("")
If Not res Is Nothing Then
Do
res.Value = res.Offset(-1, 0).Value
Set res = r.FindNext(res)
Loop Until res Is Nothing
End If
Dear,
I am sorry that I test the code in my attached excel, it doesn't work. The object viewer said. 'it doesn't work and the error message: invalid outside procedure at the code of
Set r = Range("B3", Range("E" & Rows.Count).End(xlUp))
Dim r As Range
Dim res As Range
Set r = Range("B3", Range("E" & Rows.Count).End(xlUp))
Set res = r.Find("")
If Not res Is Nothing Then
Do
res.Value = res.Offset(-1, 0).Value
Set res = r.FindNext(res)
Loop Until res Is Nothing
End If
Bookmarks