Hello all,
Just need a little help writing a macro that will merge two columns together. The columns marked “Retained Notes” and “Frozen Notes” need to be merged into one column simply marked “Notes.” The text (if any) in both columns needs to be merged into one cell in a single column with a space between the text. “Retained Notes” and “Frozen Notes” are the headers in row one. Retained Notes and Frozen Notes are always next to each other, but sometimes not in the same column letter (sometimes in col P sometimes in col O somtimes in col N, etc.). This is why I want to use the column headers in row 1 to identify the columns to merge.
See attached example.
Your sample is very small and does not clearly show what you mean by:
The text (if any) in both columns needs to be merged into one cell in a single column with a space between the text. “Retained Notes” and “Frozen Notes” are the headers in row one. Retained Notes and Frozen Notes are always next to each other, but sometimes not in the same column letter (sometimes in col P sometimes in col O somtimes in col N, etc.). This is why I want to use the column headers in row 1 to identify the columns to merge.
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Here is another sample that might better illustrate what I mean:
Wouldn't then this formula:
=Before!B2&" "&Before!C2
copied down do it?
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
Yes, however, I am trying to automate this process with a macro. Also, Retained Notes and Frozen Notes are not always in cols B and C. In some worksheets, they are in cols A and B, others they are in cols F and G, etc. This is why I want to use the header in row 1 to identify these cols to merge.
That is why I asked for a better sample... your sample doesn't illustrate the variations...
Someone can hopefully come along with a VBA solution for you...
Microsoft MVP - Excel
Where there is a will there are many ways. Pick One!
Please read the Forum Rules
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
Preferred Charities: Lupus Canada and Sick Kids Foundation.
Feel Free to Donate if you want to, for the assistance you received today.
That would be great - here's an additional sample:
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks