+ Reply to Thread
Results 1 to 4 of 4

Copy worksheet - Easy?

  1. #1
    Registered User
    Join Date
    04-03-2008
    Posts
    15

    Copy worksheet - Easy?

    Hi,

    I'm sure this is easy to do...

    I would like a document with 2 sheets (Sheet1 and Sheet2). Sheet2 would essentially be a template for Sheet1 which would be the working sheet. Sheet1 would a button on it which grabs all of the content on Sheet2 and copies it to Sheet1.

    (Sheet1 would then get edited, printed, and we need to start again with the button to get the template back.)

    Sheet1: Working sheet
    Sheet2: Established template
    Copy Sheet2 to Sheet1 > Edit Sheet1 > Print Sheet1 > Copy Sheet2 to Sheet1...etc.

    Make sense?

    Is this possible? Even better, is it possible WITHOUT Macros or VBA?

    I'm pretty new to macros, so if you post a solution, can you please detail how to include it in a button on sheet1!!! (and i guess on the template that you copy it from)!

    Thanks!!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,

    Without a macro.
    1. Clear everything on sheet 1 by selecting all cells, (click at the intersection between the column letters and row numbers), then Cut and Delete.

    2. Copy the whole of sheet 2. Select all cells as above then Copy. Select A1 on Sheet1 and Paste.

    With a macro

    Copy the following code to the Visual Basic Environment

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    04-03-2008
    Posts
    15

    Nearly!

    Thanks Richard,

    but when I do that it returns a 400 error - after searching for that error, I was still confused as to what it meant and how to fix it!

    Also, was I sipposed to copy that code into the sheet1 or the "thisworkbook" sheet?

    And i didnt know how to create a button, so i just added a circle and assigned a macro to it... im sure thats ok though...

    Thanks for your help! Also, will protecting areas of either sheet with a password affect how this is going to work? If so, is there a solution?

    Thanks!!

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Hi,
    Sorry about that. The macro assumed that the active sheet is sheet2 when you run it. That was my fault, I should have avoided that elementaray mistake. Try the following slightly revised version

    Please Login or Register  to view this content.
    You should copy it into either the 'Thisworkbook' object, or a code module.
    Yes adding any object, like a circle, is fine as a button for a macro. I often adopt this approach whilst testing something. You can of course use any sort of object - like a picture, clip art, company logo or whatever.

    HTH

+ 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