Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Rows to Colums for Mail Merge

Hello All, I tend to run into this issue a lot when prepping excel data for a
mail merge. My data tends to be supplied in rows while mail merge likes
columns. I hope someone can help me.

Column A contains Domains
Column B contains unique Sites within those domains.

There is one row for each unique site. As there can be multiple sites in
each domain column A contains repeats, sometimes more then 20.
I would like for all values in column B where column A is the same to be
transposed into the row of the first instance of that Domain.

IE:
A B
Domain.1 Domain.1.site.A
Domain.2 Domain.2.site.A
Domain.2 Domain.2.site.B
Domain.2 Domain.2.site.C
Domain.3 Domain.3.site.A

Would become€¦

A B C D
Domain.1 Domain.1.site.A
Domain.2 Domain.2.site.A Domain.2.site.B Domain.2.site.C
Domain.3 Domain.3.site.A

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Rows to Colums for Mail Merge

Hi EJBNYC,

I suspect you can do what you're after using a Catalogue/Directory Mailmerge, without the need to modify your data. To see how to do
this kind of mailmerge, check out my tutorial at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=731107
Do read the tutorial before trying to use the mailmerge document included with it.

--
Cheers
macropod
[MVP - Microsoft Word]


"EJBNYC" wrote in message ...
Hello All, I tend to run into this issue a lot when prepping excel data for a
mail merge. My data tends to be supplied in rows while mail merge likes
columns. I hope someone can help me.

Column A contains Domains
Column B contains unique Sites within those domains.

There is one row for each unique site. As there can be multiple sites in
each domain column A contains repeats, sometimes more then 20.
I would like for all values in column B where column A is the same to be
transposed into the row of the first instance of that Domain.

IE:
A B
Domain.1 Domain.1.site.A
Domain.2 Domain.2.site.A
Domain.2 Domain.2.site.B
Domain.2 Domain.2.site.C
Domain.3 Domain.3.site.A

Would become€¦

A B C D
Domain.1 Domain.1.site.A
Domain.2 Domain.2.site.A Domain.2.site.B Domain.2.site.C
Domain.3 Domain.3.site.A


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Rows to Colums for Mail Merge

Thanks Macro. Im afraid my case is a bit more complicated as the excel sheet
also contains the e-mail address for whom the messages are intended. Maybe I
should have made it clear that I am doing an e-mail type merge. In any case,
my needs are the same. I need to get all rows that match the €śkey field
(Column A)€ť to transpose to columns so mail merge can consider it one record
and ergo, one recipient yet include in one e-mail all instances of sites for
that one domain. To complicate this further, each site has unique recipients
which I plan on concatenating into one entry using the logical function I am
looking for here.

"macropod" wrote:

Hi EJBNYC,

I suspect you can do what you're after using a Catalogue/Directory Mailmerge, without the need to modify your data. To see how to do
this kind of mailmerge, check out my tutorial at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=731107
Do read the tutorial before trying to use the mailmerge document included with it.

--
Cheers
macropod
[MVP - Microsoft Word]


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Rows to Colums for Mail Merge

Hi EJBNYC,

In that case, you could you a macro like the following to output the sorted records from your current data worksheet (assumed to be
the first in the workbook) on another worksheet (assumed to be the second), which then becomes the data source for your mailmerge).
If need be, you can change the input & output worksheet indexes.

Sub ParseMergeRecords()
Dim i As Integer
Dim x As Integer
Dim y As Integer
x = 0
With ThisWorkbook.Worksheets(1)
For i = 2 To .Cells.SpecialCells(xlCellTypeLastCell).Row + 1
If .Cells(i, 1).Value < .Cells(i - 1, 1).Value Then
x = x + 1
y = 1
ThisWorkbook.Worksheets(2).Cells(x, y).Value = .Cells(i - 1, 1).Value
Else
y = y + 1
ThisWorkbook.Worksheets(2).Cells(x, y).Value = .Cells(i - 1, 2).Value
End If
Next
End With
End Sub

--
Cheers
macropod
[MVP - Microsoft Word]


"EJBNYC" wrote in message ...
Thanks Macro. Im afraid my case is a bit more complicated as the excel sheet
also contains the e-mail address for whom the messages are intended. Maybe I
should have made it clear that I am doing an e-mail type merge. In any case,
my needs are the same. I need to get all rows that match the €śkey field
(Column A)€ť to transpose to columns so mail merge can consider it one record
and ergo, one recipient yet include in one e-mail all instances of sites for
that one domain. To complicate this further, each site has unique recipients
which I plan on concatenating into one entry using the logical function I am
looking for here.

"macropod" wrote:

Hi EJBNYC,

I suspect you can do what you're after using a Catalogue/Directory Mailmerge, without the need to modify your data. To see how to
do
this kind of mailmerge, check out my tutorial at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=731107
Do read the tutorial before trying to use the mailmerge document included with it.

--
Cheers
macropod
[MVP - Microsoft Word]



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 293
Default Rows to Colums for Mail Merge

Oops! Try:

Sub SortRecords()
Dim i As Integer
Dim x As Integer
Dim y As Integer
x = 0
With ThisWorkbook.Worksheets(1)
For i = 2 To .Cells.SpecialCells(xlCellTypeLastCell).Row + 1
If .Cells(i, 1).Value < .Cells(i - 1, 1).Value Then
x = x + 1
y = 1
ThisWorkbook.Worksheets(2).Cells(x, y).Value = .Cells(i - 1, 1).Value
y = y + 1
ThisWorkbook.Worksheets(2).Cells(x, y).Value = .Cells(i - 1, 2).Value
Else
y = y + 1
ThisWorkbook.Worksheets(2).Cells(x, y).Value = .Cells(i - 1, 2).Value
End If
Next
End With
End Sub

--
Cheers
macropod
[MVP - Microsoft Word]


"EJBNYC" wrote in message ...
Thanks Macro. Im afraid my case is a bit more complicated as the excel sheet
also contains the e-mail address for whom the messages are intended. Maybe I
should have made it clear that I am doing an e-mail type merge. In any case,
my needs are the same. I need to get all rows that match the €śkey field
(Column A)€ť to transpose to columns so mail merge can consider it one record
and ergo, one recipient yet include in one e-mail all instances of sites for
that one domain. To complicate this further, each site has unique recipients
which I plan on concatenating into one entry using the logical function I am
looking for here.

"macropod" wrote:

Hi EJBNYC,

I suspect you can do what you're after using a Catalogue/Directory Mailmerge, without the need to modify your data. To see how to
do
this kind of mailmerge, check out my tutorial at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=731107
Do read the tutorial before trying to use the mailmerge document included with it.

--
Cheers
macropod
[MVP - Microsoft Word]



Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge - combining mutiple rows of data on one mailer. Kevin Rhinehart Excel Discussion (Misc queries) 0 January 16th 07 10:35 PM
Linking Multiple Rows to Use in Mail Merge Exhausted... Excel Discussion (Misc queries) 4 November 12th 06 02:20 AM
Code launches Mail Merge but disables the Mail Merge austris Excel Discussion (Misc queries) 0 October 14th 06 01:11 AM
Mail Merge? 5 Colums tbuckman Excel Discussion (Misc queries) 3 June 2nd 05 08:54 PM
Mail merge (Word97) only importing 1st 85 rows of info from Excel Kali Carringer Excel Discussion (Misc queries) 3 March 26th 05 05:33 AM


All times are GMT +1. The time now is 08:34 AM.

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

About Us

"It's about Microsoft Excel"