+ Reply to Thread
Results 1 to 14 of 14

Copying cells from existing sheets to new row of master sheet in one workbook

  1. #1
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Angry Copying cells from existing sheets to new row of master sheet in one workbook

    Dear All

    I come to this forum with almost no programming skills and less hair than I had before tackling this problem!

    I have a workbook that contains n number of sheets each containing evaluation scores which are averaged in specific cells. I would like this average scores from each sheet to automatically create a new row of data in the master sheet. The number of sheets with score varies but code should be able to parse all existing sheets for the same cells and copy them in a new row in the master (1st sheet).

    Apart from lacking the coding skills to tackle this problem I also don't know if my Excel 2008 for Mac even allows me to create the necessary code.

    Any help or pointing in the right directions is extremely welcomed!

    Many thanks

    Chico

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

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    It can be done in normal PC, but I do not know about Mac. If you want it in PC, please post a sample with a desired result.

  3. #3
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi AB33

    thank you for the prompt reply. I am attaching the spreadsheet in question. So as will hopefully be clear the n number of sheets have 5 cells of average results and a responses count (n) which need to be copied to the Master sheet in a new row. These automatically generated rows are then analysed (weighted average).
    Hope this explains my issue.
    cheers
    C.
    Attached Files Attached Files

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

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Volca!
    responses count (n). Where does figure(or row number) in sheets come from?
    Are the average formulas which are located in Row 10 are the same for all sheets? Or do they have different row numbers?
    I do not know how big is your data, but a simple linking each sheet to the master could do the job (with out macro), assuming you only want to copy a single row from each sheet to the master.

  5. #5
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi again
    not sure if there is missing text from your reply. Row 10 does not change across all data collection sheets. This data is entered by various admin staff in different centers so the cell values need to be fed automatically to a new row of the master sheet. Would the linking do this automatically (and work if sheet with linking is copied and used for new data)? Could this happen without a macro? The responses count (n) is also entered in the same cell across sheets and used in weighting formulas of the mastersheet.
    Appreciate your help and time...

    C.

  6. #6
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi Volcaremos,

    Did you try using the indirect function?

    Use the below formula in cell C8 and type A10 in cell C4.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Extend the formula till G8, however, please add B10, C10, D10 and E10 in C4, D4, E4, F4 and G4.

    This will give you all the results for Sheet 1. If you have all sheet names listed in a column (this can be done by a macro) you can easily automate it.

    Hope this helps.
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  7. #7
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi kbkumar

    sheet names are not known in advance, they reflect internal naming code of different courses which vary from semester to semester. This is why the ideal solution would not rely on specific sheet names or number of sheets (if this is possible).

    cheers

    C.

  8. #8
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Quote Originally Posted by volcaremos View Post
    Hi again
    not sure if there is missing text from your reply. Row 10 does not change across all data collection sheets. This data is entered by various admin staff in different centers so the cell values need to be fed automatically to a new row of the master sheet. Would the linking do this automatically (and work if sheet with linking is copied and used for new data)? Could this happen without a macro? The responses count (n) is also entered in the same cell across sheets and used in weighting formulas of the mastersheet.

    C.
    Since you mentioend that Row 10 across all sheets does not change and so does the Responses count, i think we can easily automate the output if we know the sheet names and use Indirect funtion as showed in post #6. The below code can pull the sheet names at any point of time:

    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi again
    using your suggestions and macro I was able to have the sheet names appear in the correct column on the Master sheet. Now I need to work out how to automatically refer to cells in other worksheets by calling on the sheet name.
    For example: Column B in Master needs to get value from cell E2 in any sheet after Master. Since the Macro kbkumar places the sheet name in column A of Master how can the cells in the same row use 'sheet name' to automatically call on values in cells A10 to E10 on all other sheets?
    Apologies for obtuse, non-tech wording. Hope you can follow...
    cheers

    C.
    Last edited by volcaremos; 11-02-2012 at 08:11 AM.

  10. #10
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Use slightly modified code:

    Please Login or Register  to view this content.
    This will generate all sheet names from cell J8 and downwards and exclude any sheet with the name "Master". I have done this because all your output data starts from row 8 in the "Master" sheet.

    Then use the below formula in cell C8 and drag it all the way down across rows and columns, and also add A10, B10, C10, D10 and E10 in cells C4 till G4.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This should hopefully automate all of your output.

  11. #11
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi kbkumar
    I appreciate your time and patience with my issue. I still have not resolved it though. I have changed your first code to output Sheet name to cells A8 onwards instead of J8 (as I want the name to appear in the first column of the master sheet).
    You then said to use the indirect formula to link to cell values in respective sheets. However I'm getting a #REF! error. Excuse the silly question but what do you mean by adding A10, ... to C4...?
    The cells in Master should look for SheetName stored in column A (same row) and from this find the correct cell in that sheet. I tried all codes found on the net to link via INDIRECT but to no avail. Not sure what I am doing wrong.
    thanks
    C.

  12. #12
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Hi - See the attached file. Is this close to what you were expecting?

    The sheet names would get populated in column a (using the macro), the cells from column B - G have the indirect formula linked to column A, so when you run the macro the values from respective sheet will get populated. Hope this helps.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    11-01-2012
    Location
    London, UK
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    [SOLVED] Copying cells from existing sheets to new row of master sheet in one workbook

    Hi Kbkumar
    that is exactly what I wanted the spreadsheet to do but did not have the skills to achieve. A massive thank you for your continued support and above all patience.
    Very grateful!
    cheers
    C.

  14. #14
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Copying cells from existing sheets to new row of master sheet in one workbook

    Glad it worked and thanks for the feedback...

+ 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