View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
DomThePom DomThePom is offline
external usenet poster
 
Posts: 54
Default Realign Columns? Imossible?

Just sort the data on each sheet by column header before copying it (assumes
that all data sheets have same number of columns and same column headers just
in a different order)

sort method of range object

Usin g same object names from Rons code gives

sh.cells(1,1).currentregion.Sort Key1:=Range("A1"), Order1:=xlAscending,
Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlLeftToRight, _
DataOption1:=xlSortNormal

"ryguy7272" wrote:

I used Ron de Bruins €˜merge cells macro:
http://www.rondebruin.nl/copy2.htm

Ive used it multiple times and the macro itself works great €“ everything is
copied to one summary sheet, named MergeSheet. Great!!! I have one small
problem now (which I never encountered before). If the data in the some of
the columns in the different sheets is not in sync, the data in some of the
columns of the MergeSheet is not in sync€¦and I cant build a Pivot Table
based on this data set. Lets say Firm Name is in Column A; this is
consistent for all columns, so were ok here. However, when I move further
to the right, Column G of MergeSheet has €˜Contact Person (because this is
the way it is on one sheet) and Column G of MergeSheet also has €˜Phone
Number (because this is the way it is on another sheet)!!! Is there a way
to get Excel to line up all the columns that have the same heading? Im
thinking this could be quite easy, quite difficult, or just totally
impossible. I cant think of a solution right now. Does anyone have any
thoughts on the matter?

Regards,
Ryan---



--
RyGuy