Results 1 to 9 of 9

Need VBA code to Copy all on a sheet to another existing sheet

Threaded View

  1. #1
    Registered User
    Join Date
    10-16-2010
    Location
    Cheshire, CT USA
    MS-Off Ver
    Excel 1997
    Posts
    9

    Need VBA code to Copy all on a sheet to another existing sheet

    I have a formatted worksheet “View Format” that needs to be copied to another existing worksheet “View Request” whenever the user makes a new request. Everything on the “View Format” sheet needs to be copied to the “View Requested” sheet. This resets (refresh) the “View Requested” sheet for the next user request.

    I was using VBA code to delete worksheet “View Requested”, then create to copy of Worksheet “View Format” that becomes “View Format (2)” then rename it to “View Requested”.

    This accomplished the refresh, but keeps incrementing the worksheet numbers in the sheet properties for “View Requested” sheet.

    I would like VBA code that will copy everything on the “View Format “ sheet to overlay everything on the “View Requested “sheet. That includes Buttons, Text, Columns, Rows, etc.

    Here is the code I am using to delete and copy the existing sheets.

     
    Sub Replace_View_Requested_Sheet()
    '
    ' Replace_View_Requested_Sheet Macro
    ' Macro created 10/22/2010 by Jim Lombardi
    
    '
        Sheets("View Requested Format").Select
        Sheets("View Requested Format").Copy Before:=Sheets(4)
        Application.DisplayAlerts = False
        Sheets("View Requested").Select
        ActiveWindow.SelectedSheets.Delete
        Application.DisplayAlerts = True
    
        Sheets("View Requested Format (2)").Select
        Sheets("View Requested Format (2)").Name = "View Requested"
        Range("A1").Select
    End Sub
    Here is the workbook:

    Jaguar XJ8 Major Repair & Safety Issues Format WIP.xls

    Look at "AT a Glance" worksheet, the option button entitled "Refreash View Requested" runs the macro "Replace_View_Requested_Sheet()". Looks like I misspelled Refresh in the option button text. Oh well, I will fix that later.

    Thank you in advance for your help with this coding.

    Jim Lombardi
    Last edited by appform; 10-24-2010 at 11:01 AM.

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