LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Do while not last row

Here's a loop I'm trying to excute that moves items in a column into
rows. I can't figure out completely how to set the loop to go under
that last row.


Sub Macro100()
lngLastRow = Cells(Rows.Count, "A").End(xlUp).Row
cnt = 4
Do While [not last row]
dst = cnt - 1
Range("A" & cnt).Select
Selection.Cut Destination:=Range("B" & dst)
Range("A" & cnt + 1).Select
Selection.Cut Destination:=Range("C" & dst)
Range("A" & cnt + 2).Select
Selection.Cut Destination:=Range("D" & dst)
Range("A" & cnt + 3).Select
Selection.Cut Destination:=Range("E" & dst)
Range("A" & cnt + 4).Select
Selection.Cut Destination:=Range("F" & dst)
Range("A" & cnt + 5).Select
Selection.Cut Destination:=Range("G" & dst)
cnt = cnt + 7
End


End Sub
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"