![]() |
|
![]() | ||
|
Subject:
Excel format
Category: Computers > Software Asked by: johngl-ga List Price: $10.00 |
Posted:
18 May 2004 18:45 PDT
Expires: 17 Jun 2004 18:45 PDT Question ID: 348531 |
I have an Excel spreadsheet. Is there a function, macro or a set of steps that would take that data and create a new worksheet where each row is now a column (with the first row repeating each column) and each new column will print on its own page? Starts out like this. 1) Header1 Header2 Header3 Header4 2) Data-1-A Data-2-A Data-3-A Data-4-A 3) Data-1-B Data-2-B Data-3-B Data-4-B 4) Data-1-C Data-2-C Data-3-C Data-4-C A new workbook (another page in the Excel spreadsheet) would look like this. Each pair of columns would print on a separate page. Header1 Data-1-A Header1 Data-1-B Header1 Data-1-C Header1 Data-1-D Header2 Data-2-A Header2 Data-2-B Header2 Data-2-C Header2 Data-2-D Header3 Data-3-A Header3 Data-3-B Header3 Data-3-C Header3 Data-3-D Header4 Data-4-A Header4 Data-4-B Header4 Data-4-C Header4 Data-4-D |
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Excel format
From: captain_paralytic-ga on 19 May 2004 02:08 PDT |
I can do you a macro if you like, but it isn't too hard manually, particularly if you are able to accept the "combined values" in a single cell rather than adjacent ones. Here are the steps. 1) Mark and copy your original area 2) Go to the new WorkSheet (you said "A new workbook (another page in the Excel spreadsheet)" a Workbook is a collection of Worksheets and each "page" is a worksheet) 3) Go to the menu item Edit->Paste Special 4) Select the Transpose check box and click OK. 5) In the cell to the right of the last item in the first row (E1 in your example) put the formula =$A1&" "&B1 6) Copy this down for all the rows 7) Copy this row to the right for (in your example) 3 columns The result is: Col E Col F Col G Header1 Data-1-A Header1 Data-1-B Header1 Data-1-C Header2 Data-2-A Header2 Data-2-B Header2 Data-2-C Header3 Data-3-A Header3 Data-3-B Header3 Data-3-C Header4 Data-4-A Header4 Data-4-B Header4 Data-4-C Now to set these in stone, copy them and paste them straight back with Edit-Paste Special selecting Values this time. Please let me know if: 1) The results in single columns rather than pairs of columns is acceptable. 2) whether you still need the macro? Enjoy |
Subject:
Re: Excel format
From: captain_paralytic-ga on 19 May 2004 02:42 PDT |
Here it is in a Macro (in paired column format): Sub for_johngl() ' ' Macro1 Macro ' Macro recorded 19/05/2004 by Paul Lautman ' ' Set OrigSheet = ActiveSheet Sheets.Add Set NewSheet = ActiveSheet OrigSheet.UsedRange.Copy NewSheet.Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True Application.CutCopyMode = False For n = 1 To ActiveSheet.UsedRange.Columns.Count - 2 Columns("A:A").Copy Columns(n * 2 + 1).Insert Shift:=xlToRight Next Range("a1").Select Application.CutCopyMode = False End Sub |
Subject:
Re: Excel format
From: johngl-ga on 19 May 2004 02:44 PDT |
A macro would be great. Having "combined values" in a single cell is fine. What about separating each column to print on a different page? Is that posible with a macro? Thank you. |
Subject:
Re: Excel format
From: captain_paralytic-ga on 19 May 2004 03:16 PDT |
Dunno if we "crossed in the post" but I had posted a macro 2 minutes before you posted your comment. |
Subject:
Re: Excel format
From: captain_paralytic-ga on 19 May 2004 05:17 PDT |
In order to obtain the printing as you require, you need to alter the macro to insert a blank column between each pair. Then if the Print area is set to non-contiguous ranges (i.e. only the columns with the data and not the blank ones), Excel will print each pair of columns on a separate page. I'm afraid that I haven't got time to knock up that part of the macro myself. |
Subject:
Re: Excel format
From: sebastienm-ga on 23 Jun 2004 21:22 PDT |
Hi johngl, Concerning the manual steps of captain_paralytic. After step 4 (after the transpose), say you have the Header1, Headder2, ... in column A, you have now: A B C D E 1 Header1 Data-1-A Data-2-A Data-3-A Data-4-A 2 Header2 Data-1-B Data-2-B Data-3-B Data-4-B 3 Header3 Data-1-C Data-2-C Data-3-C Data-4-C You can tell excel to repeat printing columns on any printed page: -menu File > Page Setup, on the Sheet tab -for 'Column To Repeat at Left', enter: $A:$A Now, just insert page breaks in front of each column of data (starting column C: Data-2-xx): - Select column C - menu Insert > Page Break - Repeat the two prior steps for other columns of data Try the print preview. Regards, Sebastien |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |