Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Molly Torres   on Nov 25 In MS Office Category.

  
Question Answered By: Hadil Khan   on Nov 25

OK.. it sounds like you want to add  the the first row  to the end  of each
subsequent row
until there is a break, then do the same for the next set.

I threw together this:
'------------------------------------------------------
Option Explicit
Sub Hdr_Copy()
Dim Last_Row, CurRow, HdrRow, inx
Dim HdrArray(10)
Last_Row = ActiveCell.SpecialCells(xlLastCell).Row
HdrRow = 1
inx = 0
For CurRow = 1 To Last_Row
If (Cells(CurRow, 1) <> "") Then
If (CurRow = HdrRow) Then
HdrArray(0) = CurRow
For inx = 1 To 8
HdrArray(inx) = Cells(CurRow, inx)
Next inx
Else
For inx = 1 To 8
Cells(CurRow, inx + 15) = HdrArray(inx)
Next inx
End If
Else
HdrRow = CurRow + 1
For inx = 0 To 9
HdrArray(inx) = ""
Next inx
End If
Next CurRow
End Sub
'------------------------------------------------------
It makes the assumptions that A) the header  row has (8) cells, and B) the data
rows each have (15) fields.

Is that what you're looking for?

Share: 

 

This Question has 3 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Help please Or get search suggestion and latest updates.


Tagged: