View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Copy Row Above, with a Twist Q

Hi,

Am Thu, 5 Jan 2017 01:14:50 -0800 (PST) schrieb :

Claus, that didn't do anything, still last row hasn't copied


try:

Sub Test()
Dim LRow As Long
Dim myRng As Range, rngC As Range

With ActiveSheet
LRow = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
Set myRng = .Range("A2:A" & LRow)
myRng.Select
For Each rngC In myRng
If Len(rngC) = 0 Then
rngC = rngC.Offset(-1, 0)
rngC.Offset(, 1) = "ABC"
If Len(rngC.Offset(-1, 2)) = 0 Then
rngC.Offset(, 2) = rngC.Offset(-1, 3)
Else
rngC.Offset(, 3) = rngC.Offset(-1, 2)
End If
End If
Next
End With
End Sub


Regards
Claus B.
--
Windows10
Office 2016