Import/Merge Question

boggette

New Member
Joined
Oct 25, 2006
Messages
1
I have some very large files that I import into Excel, then have to reformat to merge some cells. What I currently have, for example, is

Top
Sub 1 Sub 2
sub-sub1 sub-sub2 sub-sub3 sub-sub4

What I'd like is for the following:

------------------------Top
---------Sub 1-------------------Sub 2
sub-sub1 sub-sub2 sub-sub3 sub-sub4

(note that dashes are there because this interface is removing my spaces)

Top would be a merge of columns 1-4 and Centered.
Subs 1 & 2 would be a merge of columns 1 & 2, and 3 & 4, respectively, then centered.

There are thousands of rows and columns and there are multiple instances of Top lines, sub lines, and sub-sub lines.

I can't get the data to merge and center via the Import feature. It there a way to write a macro that would find and modify these? The actual text of the rows changes with each row, so I can't simply search for the word "top" and merge it with the next 3 columns.

Anyone have any ideas for me?
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

Watch MrExcel Video

Forum statistics

Threads
1,113,955
Messages
5,545,162
Members
410,667
Latest member
Gaexel
Top