+ Reply to Thread
Results 1 to 10 of 10

Macro to create worksheet, change it's position, and paste date into it.

  1. #1
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Macro to create worksheet, change it's position, and paste date into it.

    Hi, I need a macro that will create a new blank worksheet, move it to the last spot and paste the entire contents of the sheet named "master" into the newly created sheet.
    I have tried to do this with the recorder but have been unable to get it to work.

    Thanks!
    Clayton

  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 create worksheet, change it's position, and paste date into it.

    Hello Clayton,

    Here is the code...
    Please Login or Register  to view this content.
    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
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to create worksheet, change it's position, and paste date into it.

    Any particular name for this worksheet? Or method of creating a name?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Re: Macro to create worksheet, change it's position, and paste date into it.

    The new sheet will not be named anything in particular.

    Leith, I will give you code a try when I get home in a little while.

    Thanks!
    Clayton

  5. #5
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Re: Macro to create worksheet, change it's position, and paste date into it.

    Leith, the code you provided makes an exact copy of the "Master" sheet, but all I need copied is the stuff on it. Using your code, I came up with the macro below. It creates a new sheet at the end, so all I need it to do now is copy the entire master sheet to the new sheet. I hope that makes sense. It is 1AM here.

    Please Login or Register  to view this content.

  6. #6
    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 create worksheet, change it's position, and paste date into it.

    Hello Clayton,

    This macro will copy the "Master" sheets values only to the newly created sheet. No formatting is copied over, just the cell values.
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-16-2008
    Location
    Mansfield, TX
    Posts
    324

    Re: Macro to create worksheet, change it's position, and paste date into it.

    Thanks leith! If I wanted to paste the formatting as well, what would I need to change? I ask because I have another application for this macro the calls for the data and the formatting to be pasted.

    Thanks again!
    Clayton

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to create worksheet, change it's position, and paste date into it.

    You're straying from the simple answer...Leith already showed you how to make an exact copy of a sheet. Just add one more line to remove all the formulas on that copy:
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    08-19-2009
    Location
    MN, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro to create worksheet, change it's position, and paste date into it.

    Ok, this works awesome with a button. How can I make it so that when they click that button, it names that new worksheet with today's date?

    Thanks!

  10. #10
    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 create worksheet, change it's position, and paste date into it.

    Hello BBXguy,

    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.

+ 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