+ Reply to Thread
Results 1 to 5 of 5

Command to 'overwrite' existing sheet

  1. #1
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Command to 'overwrite' existing sheet

    Hi all,

    I have a macro I am running to pull reports from 2 different sheets and pasting to a new sheet:

    Please Login or Register  to view this content.
    What I want to include is a command at the beginning of the code so that even though there is already a sheet called "STAT-2011" (created the month prior) the macro will 'overwrite' that sheet and create the new one?....

    TIA
    Last edited by Greed; 12-14-2011 at 12:56 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Command to 'overwrite' existing sheet

    A short cut is to add this at the beginning - it will delete sheet first if extant:
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,161

    Re: Command to 'overwrite' existing sheet

    You'll have to "try" to delete it first:

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    07-15-2011
    Location
    Whitby, Canada
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Command to 'overwrite' existing sheet

    Thanks to you both!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    45,161

    Re: Command to 'overwrite' existing sheet

    You're welcome. Thanks for the rep.

+ 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