+ Reply to Thread
Results 1 to 8 of 8

Adding the same header row to multiple spreadsheets

  1. #1
    Registered User
    Join Date
    01-31-2009
    Location
    Romania, Eastern Europe
    MS-Off Ver
    Excel 2007
    Posts
    25

    Adding the same header row to multiple spreadsheets

    Hello everyone

    I have several data files (each in XLS format) that are the output of an experiment. Unfortunately, the files were created (in Matlab) without header rows, so it's hard to keep track of what each of the 10+ columns mean. I would therefore like to add a header row (the same header row) to each one of these spreadsheets, but I cannot figure out a way to do this automatically. I have hundreds of data files, and opening each one of them, pasting the header row and saving would take a lot of time.

    Can anyone suggest a way to do this? Anticipated thanks for any replies!

    Also, I really need to be able to do this quite soon, therefore apologies for cross-posting this on another Excel forum as well (will mark both as solved when they are)
    Last edited by longtalker; 03-23-2011 at 11:01 AM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Adding the same header row to multiple spreadsheets

    Try this

    Select and copy the headers you want to replicate.

    Group the sheets, you want to add the headers.
    Click on the first of the sheet tabs, then hold down the Shift key while you click on the other tabs to be included.

    Press Enter
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    01-31-2009
    Location
    Romania, Eastern Europe
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Adding the same header row to multiple spreadsheets

    Quote Originally Posted by Marcol View Post
    Try this

    Select and copy the headers you want to replicate.

    Group the sheets, you want to add the headers.
    Click on the first of the sheet tabs, then hold down the Shift key while you click on the other tabs to be included.

    Press Enter
    Thanks for your reply! My data files are in one spreadsheet (i.e. XLS file) each, therefore I cannot select them with Shift+click... Is there anything else I can try?

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Adding the same header row to multiple spreadsheets

    1/. Are all the files in one location?
    2/. How are they named?
    3/. Do they all have the same structure/Layout?

    If they have a common format, can you post a stripped down sample?

  5. #5
    Registered User
    Join Date
    01-31-2009
    Location
    Romania, Eastern Europe
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Adding the same header row to multiple spreadsheets

    See answers within the quoted text below

    Quote Originally Posted by Marcol View Post
    1/. Are all the files in one location?
    YES - SAME FOLDER
    2/. How are they named?
    FOR EXAMPLE: NumberAcuity, subject 17, 2011.02.08, 13.30.53.csv
    3/. Do they all have the same structure/Layout?
    YES - SEE BELOW

    If they have a common format, can you post a stripped down sample?
    78 32 40 88 99 0.029723 0.03 0 0 3.459
    79 32 40 88 99 0.031639 0.03 0 0 1.52
    14 16 14 88 99 0.028311 0.0373 1 2 2.332
    40 16 20 88 99 0.038623 0.03 0 0 2.199
    66 32 34 99 88 0.025157 0.03 1 1 2.254
    13 16 14 88 99 0.026518 0.03 0 2 3.201
    35 16 19 99 88 0.029557 0.03 0 0 2.961
    65 32 34 99 88 0.02249 0.032399 1 2 1.592
    54 32 28 99 88 0.025909 0.035938 0 1 4.051
    4 16 12 99 88 0.02688 0.034161 1 1 1.13
    Thanks again

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Adding the same header row to multiple spreadsheets

    When I asked
    ........can you post a stripped down sample?
    I meant a workbook showing the headers you require, some data, and the sheet layout.

  7. #7
    Registered User
    Join Date
    01-31-2009
    Location
    Romania, Eastern Europe
    MS-Off Ver
    Excel 2007
    Posts
    25

    Re: Adding the same header row to multiple spreadsheets

    I was hoping to find a way to do this without using a macro, but I doubt this is possible, anyway I managed to do this in the meantime, Hans from Microsoft Answers kindly provided the code for the following macro which does just what I was asking for:

    Please Login or Register  to view this content.
    Thanks again Marcol, and again apologies for the cross-posting.
    Last edited by longtalker; 03-24-2011 at 07:39 AM.

  8. #8
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Adding the same header row to multiple spreadsheets

    Hi longtalker

    Sorry for not helping further, but without a bit more information that can be difficult.

    Tip:= Please wrap your code in code tags, before the moderators get you...

    Forum rules
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button.

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1