Closed Thread
Results 1 to 8 of 8

macro to copy specific cells from multiple sheets

  1. #1
    Registered User
    Join Date
    06-21-2011
    Location
    England
    MS-Off Ver
    2013
    Posts
    48

    macro to copy specific cells from multiple sheets

    Hello all,

    I need a macro to copy certain cells from many sheets into a new one. I am attaching a sample. what I want to do is copy cells "G5" "G6" "G18" from the sheets with the month names (not the main one) into a new one and put them in three different columns (all G5s, G6s, G18s).

    Many thanks in advance
    Attached Files Attached Files
    Last edited by Costasg; 07-07-2011 at 05:34 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: macro to copy specific cells from multiple sheets

    Hello Costasg,

    This macro will create a worksheet called "Summary" and add the ranges G5:G6 and G18 from each monthly sheet into columns "A:C. This macro has been added to the attached workbook.
    Please Login or Register  to view this content.

    To Run the Macro...
    To run the macro from Excel, open the workbook, and press ALT+F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    10-16-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2003, 2013
    Posts
    17

    Re: macro to copy specific cells from multiple sheets

    Hello,

    There is most likely a better way to achieve your request. Although, I am new to this and figured I could help. Also look at the OrSheet, it will display the value on the page even when changed. Hope I could help.


    Regards,
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    10-16-2010
    Location
    Michigan
    MS-Off Ver
    Excel 2003, 2013
    Posts
    17

    Re: macro to copy specific cells from multiple sheets

    Wow Leith, that is very efficient. I posted without refreshing so I did not see your reply. Puts my mess of code to shame. Good Work!
    Last edited by Thrux; 07-07-2011 at 02:28 AM.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: macro to copy specific cells from multiple sheets

    Hello Thrux,

    You code isn't really all that bad. You have the concept of what needs to be done and that's about 50 percent of the battle. The macro recorder is a stepping stone. The code it produces works but isn't refined.

    As you do more coding, and visit the boards for ideas, your code will become better and better. None of us were born knowing all this. It takes time to learn it and then a little more time to refine it.

  6. #6
    Registered User
    Join Date
    06-21-2011
    Location
    England
    MS-Off Ver
    2013
    Posts
    48

    Re: macro to copy specific cells from multiple sheets

    Many thanks for your valuable help guys! You just saved me a lot of time.

  7. #7
    Registered User
    Join Date
    05-11-2012
    Location
    Mississauga Ontario
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: macro to copy specific cells from multiple sheets

    OK, this is awesome, Leith. I'm struggling with getting this to write to a new workbook instead of a new worksheet. When I add a piece of code to create a new workbook, that new workbook becomes the main workbook and I cann't get the summary to refer to the "old" workbook. Any suggestions?
    Last edited by mcollins999; 05-24-2012 at 09:16 AM.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: macro to copy specific cells from multiple sheets

    Mcollins999,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed 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