+ Reply to Thread
Results 1 to 3 of 3

VBA Macro copy a sheet / it is disappearing

  1. #1
    Registered User
    Join Date
    10-06-2021
    Location
    Ohio,USA
    MS-Off Ver
    97 - current
    Posts
    4

    VBA Macro copy a sheet / it is disappearing

    Hi everyone,

    I am new to VBA and macros and I recently started a new position and am updating the macros for this document. What happens is I am sent a report and I rename the file to today's date in a folder. There is a VBScript that opens an excel file template that has a Template sheet and a lookup sheet.

    The VBScript opens the template and executes the two macros. One of the macros sends an email which is working fine, but the other one copies all the information needed from the report that is renamed to today's date.

    Upon completion of the script the error is in column Y of my report because it is a VLOOKUP function that references a lookup sheet that is on the original template.

    How do I make it so that sheet remains. I have attached what I believe is needed.

    The excel help file has the macro I believe is causing the issue as the other macro sends an email. It also contains the Lookup sheet that gets deleted or not copied.

    Any help would be greatly appreciated!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA Macro copy a sheet / it is disappearing

    Your example file doesn't show the VLOOKUP formula. I'm assuming the VLOOKUP formula in column Y is already in the original daily report before you copy it to the template?

    If yes, the easiest fix would be to convert the Template VLOOKUP formulas to values after copying column Y to the template, but before closing the original report.
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 10-06-2021 at 10:59 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    10-06-2021
    Location
    Ohio,USA
    MS-Off Ver
    97 - current
    Posts
    4

    Re: VBA Macro copy a sheet / it is disappearing

    Hi AlphaFrog,

    Thank you for the response I appreciate it.

    The formula is pasted in when the macros are ran, but the issue is the Lookup Sheet that I have in my file is no longer there.
    When I run the report I get a file like this, while the formula for column y is correct, the sheet the VLOOKUP references is no longer there.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Disappearing Sheet Protection
    By kyle4570 in forum Excel General
    Replies: 3
    Last Post: 07-12-2021, 09:29 AM
  2. Excel Track Changes History Sheet Keeps Disappearing
    By excel12121 in forum Excel General
    Replies: 0
    Last Post: 06-08-2016, 09:05 PM
  3. [SOLVED] Data Disappearing into the twilight zone, Copy Cells marco mystery
    By Learning ExL in forum Excel - New Users/Basics
    Replies: 9
    Last Post: 04-19-2015, 06:53 AM
  4. =sheet function keeps disappearing in formule
    By drgogo in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-09-2011, 05:41 AM
  5. Excel 2007 : Disappearing Sheet Tabs
    By Phraedrique in forum Excel General
    Replies: 0
    Last Post: 05-11-2011, 01:53 PM
  6. [SOLVED] Why do sheet tabs keep disappearing? Box in Tools is checked.
    By Arlie in forum Excel General
    Replies: 1
    Last Post: 01-05-2006, 09:18 AM
  7. [SOLVED] Disappearing sheet?
    By Access rookie in forum Excel General
    Replies: 2
    Last Post: 01-03-2005, 09:06 PM

Tags for this Thread

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