View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.setup
AFSSkier AFSSkier is offline
external usenet poster
 
Posts: 94
Default Snaking columns in Excel

Assume, works great!

Thank you very much, Kevin


"Gord Dibben" wrote:

Revised.................you do the math if number of rows per set is not
correct

Sub Move_Sets()
Dim iSource As Long
Dim iTarget As Long

iSource = 2
iTarget = 2
Range("A1:B1").Copy Range("C1:H1")
Do
Cells(iSource, "A").Resize(54, 2).Cut _
Destination:=Cells(iTarget, "A")
Cells(iSource + 54, "A").Resize(54, 2).Cut _
Destination:=Cells(iTarget, "C")
Cells(iSource + 108, "A").Resize(54, 2).Cut _
Destination:=Cells(iTarget, "E")
Cells(iSource + 162, "A").Resize(54, 2).Cut _
Destination:=Cells(iTarget, "G")
iSource = iSource + 216
iTarget = iTarget + 55 'insert a blank row

Loop Until IsEmpty(Cells(iSource, "A").Value)

End Sub


Gord


On Mon, 2 Mar 2009 10:57:03 -0800, AFSSkier
wrote:

Gord,

Your macro for snaking columns works great. However, I need the column
headers in A1 & B1 repeated to C1 & D1 and throughout the spreadsheet.

Also have a different 2 column I need to snake to 8 columns (4 sets) in the
same manner. Each page is 54 rows at the page break.