+ Reply to Thread
Results 1 to 6 of 6

Macro to copy sheets

  1. #1
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Macro to copy sheets

    Hi all,

    ScreenHunter_004.jpg

    I want a macro,

    1. Copy A4 to C2
    2. Copy Sheet1 to a new sheet, and rename it as the content at C2, in this case "17 05"
    3. Goto sheet "17 05", copy cells D2:E2 and paste only the values onto the same cells, ignore the formula. In this case 6 and 18.
    4. Return to Sheet1, look down next value "17 04" and do the same as above.
    5. The macro stops when it detects nothing at A7.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Macro to copy sheets

    Hi Kent97

    Is this what you are after?
    Please Login or Register  to view this content.
    Last edited by sintek; 06-15-2017 at 01:33 PM. Reason: Amended code
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Macro to copy sheets

    Hi sintek,

    The macro stop with error message "variable not defined"

    ScreenHunter_008.jpg

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Macro to copy sheets

    In your sample...the Main sheet is sheet1...Right.
    Try with amended code in Post 2
    Last edited by sintek; 06-15-2017 at 01:32 PM.

  5. #5
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Macro to copy sheets

    Thank you sintek, the amended code is perfect.

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,336

    Re: Macro to copy sheets

    Glad i could help...Thanks for rep +

+ 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] Macro to Copy to other Sheets
    By Vincent.Eymard in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2017, 05:17 AM
  2. [SOLVED] Macro to copy cell width to new sheets (ie copy original sheet format)
    By teenyjem in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2013, 07:28 AM
  3. Macro that will copy from one cell across all sheets except for three sheets.
    By glide2131 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-07-2013, 09:49 PM
  4. macro for copy spread sheets
    By nucu in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-20-2013, 08:48 PM
  5. macro to copy info to other tab-sheets, then print those sheets
    By zatarra in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-29-2012, 08:02 PM
  6. [SOLVED] Copy Sheets Macro
    By WBTKbeezy in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-24-2006, 03:55 PM
  7. [SOLVED] Macro to copy sheets
    By FGOMEZ in forum Excel General
    Replies: 1
    Last Post: 07-15-2005, 02:05 PM

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