+ Reply to Thread
Results 1 to 9 of 9

Copy data from header to header in consolidation sheet

  1. #1
    Registered User
    Join Date
    04-19-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    49

    Copy data from header to header in consolidation sheet

    Hi,

    I have the data in multiple sheets with mulitple columns, the data has to be consolidated in the consolidated sheet. All the data has to read header name in each column and corresponding data has to be copied in the consolidation sheet. This is just a sample file and in every WS, I would be having nearly 150 to 200 columns. The macro should copy paste the data from each WS to the consolidated sheet.

    please help me on this.

    thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy data from header to header in consolidation sheet

    Hi, Ignesh,

    only those column headers that are to be found in sheet consilidation? Or shall the Headers/Columns be updated there as well (Sheet4 shows address)?

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    04-19-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Copy data from header to header in consolidation sheet

    Hi Ciao,

    Only the headers which are in consolidation has to be found out and data of those columns have to be retrieved to the consolidation sheet.

    Sorry for not being clear in the first note.

  4. #4
    Forum Contributor
    Join Date
    08-22-2012
    Location
    nj, us
    MS-Off Ver
    Excel 2010
    Posts
    163

    Re: Copy data from header to header in consolidation sheet

    Please Login or Register  to view this content.
    should do the trick

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy data from header to header in consolidation sheet

    Hi, Ignesh,

    you maybe have to come back regarding the items in the headers as this is not to copy a lot of information from the other sheets.

    Code may look like this
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Ciao,
    Holger

  6. #6
    Registered User
    Join Date
    04-19-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Copy data from header to header in consolidation sheet

    While running the macro, I am getting error message. The error message is 400.

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy data from header to header in consolidation sheet

    Hi, Ignesh,

    did you test the code on the sample or your real workbook? I have tested the code on the sample on both Excel2013 as well as Excel2003 and could not raise that error. Is there protection set for any of the worksheets? Could you specify wheree exactly the error is raised (line should be marked in yellow)? Is there any data copied over or is it being raised before any copying?

    Ciao,
    Holger
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    04-19-2012
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2010
    Posts
    49

    Re: Copy data from header to header in consolidation sheet

    Hi,

    The macro is running but there is no data copied on the consolidation sheet. Cells are blank.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy data from header to header in consolidation sheet

    Ignesh,
    Try the attached. Some of the headers in the consolidation sheet do not match with headers in individual sheets. The code works on EXACT MATCH ONLY.
    Attached Files Attached Files

+ 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