+ Reply to Thread
Results 1 to 10 of 10

Need to copy text between worksheets in same workbook to consolidated sheet in same book

  1. #1
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Need to copy text between worksheets in same workbook to consolidated sheet in same book

    Hi,
    I am very new to VBA and have poured over posts that seem relevant but just dont have a clear understanding of how to make my code work.

    I have one sheet for each day of the month with a table that has Employee Name, Reason, and Expected Return. I need to copy each line into the monthly sheet, but each day may have varying number of rows. Needless to say I would like to do this without copying lots of blank lines into my consolidated sheet.


    Many thanks in advance for all your help!!
    Attached Files Attached Files

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

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    Darc,
    I suspect part of reason for not getting a reply is due to do with merged cells. VBA and merged cells are not good friends. In fact some people will not touch a sheet which has merged cells. In order for the code to work, I need to remove the merged cells from all sheets, otherwise the code will not work. Look at the columns now after I unmerged cells, some of the columns jumped 2 columns to the right.

    There is a button on sheet March
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    AB33 - thank you for taking a look at it, didnt realize that merging cells was such an issue. Since this is more function over form I can redo it similar to the way you formatted it without the merged cells. The code you used unmerged the cells, correct? What would it look like if you were to start with a completely unmerged Workbook? I have attached a new workbook with out the merged cells.

    Thank you so much for your help on this!!
    Attached Files Attached Files

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

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    Try the attached.
    The site has been down all day today and I might not reply until tomorrow.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    AB33 - Thank you so mcuh for your help, this works. In looking at the consolidation is there a way to have it skip days when there is nothing entered so that it does not repeat the text from the third column in the blank line? Also, and I am sorry to be a pain but just curious if it is possible to put a limit on the number of rows that it checks for data, thus there can be other information put below this box without messing up the result. Many many thanks!!

  6. #6
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    AB33 - Thank you so mcuh for your help, this works. In looking at the consolidation is there a way to have it skip days when there is nothing entered so that it does not repeat the text from the third column in the blank line? Also, and I am sorry to be a pain but just curious if it is possible to put a limit on the number of rows that it checks for data, thus there can be other information put below this box without messing up the result. Many many thanks!!

    Not sure if this posted to the thread as the site was having some issues. I am working on understanding the code you used, still having the same issue on handling the rows without data.

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

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    Hi Darc,
    Please attach a sample which mimics your actual data and a desired result.

  8. #8
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    AB33,
    Attached is a file that has the text data that i would like brought to the main "monthly" tab supplied by the daily tabs. Hopefully you will be able to help me with the upper and lower bands of rows to be copied from the daily onto the monthly, is expanding the size of the space possible as it adds text? I really appreciate you helping me, I am working my way through a dummies book so i am getting a better handle on building macros, but still far from where i need to be.

    Dar
    Attached Files Attached Files

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

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    Darc,
    Not clear!
    In post # 6, you said

    In looking at the consolidation is there a way to have it skip days when there is nothing entered so that it does not repeat the text from the third column in the blank line?

    if it is possible to put a limit on the number of rows that it checks for data, thus there can be other information put below this box without messing up the result.

    I want to see these request in your data, but the last attached has a completely new request.
    I do not see any data in the out put tab. You have data at the bottom which appears to add from all tabs. How are these related to the original question, or is this new request?
    I need to see what the code is supposed to do but is not doing.

  10. #10
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    AB33 -
    I am sorry I was not clear. I didnt save the proper Example file so it didnt have the macro to consolidate the data to the monthly page. As you can see when you execute the macro you will see that it copies the sheets over but on days that there is no entry it duplicates the last entry of the prior line. You then asked to see what the final will look like, nothing needs to happen with the data below the first table - but it also should not be copied into the monthly consolidated tab.

    I hope with the new example file you will have a clearer understanding of where i am.

    Darc
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    02-17-2014
    Location
    Norfolk, Texas
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Need to copy text between worksheets in same workbook to consolidated sheet in same bo

    Many thanks AB33 for helping me - the last update you sent fixed the duplication of data!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Copy row if cell value equals string - All worksheets in book to new sheet
    By psl in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2013, 11:27 AM
  2. Macro to Copy multiple worksheets into a consolidated file
    By Crossy in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-11-2013, 02:35 AM
  3. Replies: 2
    Last Post: 07-18-2012, 08:21 AM
  4. Copy active sheet to a new workbook, close that work book and return
    By nig_44 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2012, 02:24 AM
  5. Copy a worksheet as a new workbook with sheet and book name from a list
    By simondon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-31-2011, 10:52 AM

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