+ Reply to Thread
Results 1 to 8 of 8

Excel Template Erases Randomly - Macro Problem?

  1. #1
    Registered User
    Join Date
    07-15-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    80

    Excel Template Erases Randomly - Macro Problem?

    Hi everyone I have 2 spreadsheets.

    The Tracker is where you start the basics and then click the command button to generate the form, with some of the fields populated.
    From there the form is what is what is worked in until closure. When the form is closed, the command button will be clicked, and will send some of the data back to the tracker and save the form as a PDF.

    What I am having issues with, is even though the form is being saved as it is being worked on, the next time it is opened up, all the info is gone including the info that was auto-populated by the tracker. This does not happen every time, but is causing issues. I can't quite figure out where the issue would happen, does anyone have any ideas?

    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    08-12-2020
    Location
    Atlanta, Georgia
    MS-Off Ver
    Office 16
    Posts
    241

    Re: Excel Template Erases Randomly - Macro Problem?

    hi Kyhosa,
    Open the VBA by right clicking on the spreadsheet tab and view the code in the module. Under Debug select Step Into, or press F8. This will run your macro one line at a time. You will need to press F8 in order to make it progress through the Macro. Watch your form to see if you can determine when the info is erased so you can determine the line the code is at that is doing this. Study the line to see if you can find the issue. If not, report it back here and somebody may be able to help.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: Excel Template Erases Randomly - Macro Problem?

    .
    #1 : After reviewing your code in both workbooks, there does not appear to be anything that tells Excel to load data into the FORM when the workbook is opened.

    #2 : Question: Why are you using two workbooks when a single workbook would suffice ?

  4. #4
    Registered User
    Join Date
    07-15-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    80

    Re: Excel Template Erases Randomly - Macro Problem?

    Logit: I used 2 because one of the spreadsheets is more of a general data log that I can pivot on multiple different entries. The other sheet is where detailed data is added, for one item at a time. Does this make sense?

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: Excel Template Erases Randomly - Macro Problem?

    .
    I'm confused.

    Are you exchanging the terms "Sheet" and "Workbook" for one another ?

    When you open Excel it create a single workbook that contains 3 sheets (or worksheets).

    Are you working with a single workbook ... with your form on one of the sheets and your collection of data on another sheet ?

    Or are you truly using two different workbooks?

  6. #6
    Registered User
    Join Date
    07-15-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    80

    Re: Excel Template Erases Randomly - Macro Problem?

    Yes sorry, workbook

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,010

    Re: Excel Template Erases Randomly - Macro Problem?

    .
    If possible you should use only one workbook - having your form on one sheet and the data on the other sheet.

    Again, there is nothing in your code that appears to "load" the data into the form when you open the workbook or the form.

  8. #8
    Registered User
    Join Date
    07-15-2016
    Location
    Wisconsin
    MS-Off Ver
    2010
    Posts
    80

    Re: Excel Template Erases Randomly - Macro Problem?

    I will work on trying one workbook, just not sure how well that will work for what I need.

+ 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. Macro erases formulas
    By bgcm in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-15-2016, 09:44 PM
  2. Macro template good saved but running macro with imported data problem
    By brazilexcel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-18-2015, 10:42 PM
  3. Macro erases data inputted
    By luke.guthrie23 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2013, 09:12 AM
  4. [SOLVED] Problem with macro that resets and erases new data each time it is run.
    By SMcuthbert in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 08-19-2013, 02:27 PM
  5. [SOLVED] Need a Macro Function that erases dependent cells until dropdown box is selected!
    By voelkerl in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-11-2013, 08:20 AM
  6. Replies: 0
    Last Post: 05-12-2012, 09:30 AM
  7. template macro executing problem the 2nd time
    By MAB in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2006, 08:10 AM

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