View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Rachel Rachel is offline
external usenet poster
 
Posts: 113
Default Problem with Loop

I have the following code so far:
row1 = 2

Do Until Sheets("OLE1").Range("L" & row1).Value = Empty
If Trim(Sheets("OLE1").Range("M" & row1).Value) < "" Then

Sheets("OLE1").Range("K" & row1).Copy
Sheets("OLE1").Range("K" & row1 + 1).PasteSpecial Paste:=xlPasteValues
'' Sheets("OLE1").Range("K" & row1 + 1).Select

End If
row1 = row1 + 1
Sheets("OLE1").Range("K" & row1 + 1).Select
Loop
End Sub


Example of my data:

K L M
1 1280.98 SB014
2 20522.19 SB014
3 11401.21 SB014
4 12365.00 SB014 1.10000
5 1594.00 SB014 1.10000
6 665.00 SB014 7.75375
7 154.00 SB014 7.75375

Is it possible to copy K4 to K5 and then the code move to K6 and copy K6 to
K7?

Cheers!