PC Review


Reply
Thread Tools Rate Thread

Copy/Transpose into a matrix of merged cells. Use Offset formula orVBA ?

 
 
u473
Guest
Posts: n/a
 
      1st Oct 2010
The test source is an Excel worksheet of 7 rows and 5 Cols inclusive
of headers.
I cannot use Transpose because the destination is a matrix of merged
rows.
Cell A1 of the source will go in the merged cells of A1:A4 in the
destination sheet.
Cell B1 of the source will go in the merged cells of A5:A8 in the
destination sheet, etc...
How do I accomplish this ?. I have been trying to use Offset formulas
without satisfaction.
Would VBA be the answer ? If so how ?
Note : the merged rows are a constant merge of 4 rows.
The source sheet does not have merged cells.
Help appreciated.
J.P.
 
Reply With Quote
 
 
 
 
Per Jessen
Guest
Posts: n/a
 
      1st Oct 2010
This should do it:

Sub TransposeToMergedCells()
Dim StartCell As Range
Dim DestCell As Range

Set StartCell = Worksheets("Sheet1").Range("A1") 'Source sheet
Set DestCell = Worksheets("Sheet2").Range("A1") 'Destination sheet

For c = 1 To 5
For r = 1 To 7
DestCell.Offset(0, r - 1) = StartCell.Offset(r - 1, c - 1)
Next
Set DestCell = DestCell.Offset(1, 0)
Next
End Sub

On 1 Okt., 17:41, u473 <u...@aol.com> wrote:
> The test source is an Excel worksheet of 7 rows and 5 Cols inclusive
> of headers.
> I cannot use Transpose because the destination is a matrix of merged
> rows.
> Cell A1 of the source will go in the merged cells of A1:A4 in the
> destination sheet.
> Cell B1 of the source will go in the merged cells of A5:A8 in the
> destination sheet, etc...
> How do I accomplish this ?. I have been trying to use Offset formulas
> without satisfaction.
> Would VBA be the answer ? If so how ?
> *Note : the merged rows are a constant merge of 4 rows.
> * * * * * *The source sheet does not have merged cells.
> Help appreciated.
> J.P.


 
Reply With Quote
 
u473
Guest
Posts: n/a
 
      1st Oct 2010
You made my day.
Thank you, very, very much.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I transpose cells associated with a merged cell? rt_at_sea Microsoft Excel Worksheet Functions 0 27th Apr 2009 09:53 AM
How to Offset to get past merged cells ? Fred Microsoft Excel Programming 0 26th Apr 2007 05:59 PM
Merged cells .Offset(row,Col) inconsistancies =?Utf-8?B?Um95IFBlY2s=?= Microsoft Excel Programming 1 7th Mar 2007 02:07 PM
Offset and Merged cells Jim Microsoft Excel Programming 3 13th Oct 2006 04:21 PM
Offset function with merged cells MacroDaddy Microsoft Excel Programming 1 8th Jan 2004 05:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:59 PM.