2003 VBA Excel replace worksheet

Reply

  #1  
Old 11-29-12, 03:20 PM
Member
Thread Starter
Join Date: Jul 2006
Location: Central MN
Posts: 556
2003 VBA Excel replace worksheet

I have a worksheet set up in excel 2003 that acts as a database. It is one of many worksheets in a workbook I have. It is labled "database". I have figured out how to save that as a seperate file use VBA so if anything happens to the main there is a back up. This file is named "database backup" and is stored in "my documents."

Now I need to figure out how to inport that backup file into my active workbook, over-writing the existing sheet.

The name "database" must remain as I have various forms that use it.
 
Sponsored Links
  #2  
Old 11-30-12, 04:07 AM
Member
Join Date: Feb 2006
Location: USA
Posts: 6,527
Likes Received: 3
Excel Spreadsheet

Open the backup file, select the entire worksheet, copy, open active worksheet, and paste. Try this on a pair of "dummy" files first to make sure you get the results you want.
 
  #3  
Old 11-30-12, 06:08 AM
Member
Thread Starter
Join Date: Jul 2006
Location: Central MN
Posts: 556
I know how to do it manually. I am looking to write a script in VBA that will do this with the click of a button.
 
  #4  
Old 12-01-12, 05:31 AM
Member
Join Date: Feb 2006
Location: USA
Posts: 6,527
Likes Received: 3
VBA Script

You may find the info below to your liking:

How to Write a VBA Script | eHow.com

Hope this helps.
 
Reply

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Thread Tools
Search this Thread
Display Modes