Results 1 to 5 of 5

Need help with debug issue with macro

Threaded View

  1. #1
    Registered User
    Join Date
    09-03-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    37

    Need help with debug issue with macro

    I have a macro for a count down timer that works fine until I open another excel file. I get the debug error message. Can anyone help me with my code so this does not happen? I attached a pic of the line that Excel highlights when I open a new excel file and then I also pasted my timer code. Thanks

    Dim gCount As Date
    'Updateby20140925
    Sub Timer()
    gCount = Now + TimeValue("00:00:01")
    Application.OnTime gCount, "ResetTime"
    End Sub
    Sub ResetTime()
    Dim xRng As Range
    Set xRng = Application.ActiveSheet.Range("E1")
    xRng.Value = xRng.Value - TimeSerial(0, 0, 1)
    If xRng.Value <= 0 Then
    MsgBox "Countdown complete."
    Exit Sub
    End If
    Call Timer
    End Sub
    Attached Images Attached Images

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Code Runs in Debug Mode But Returns Type Mismatch Error Outside Debug Mode
    By valerie.k.chiang in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-24-2014, 03:48 PM
  2. Macro is hanging. Help me debug?
    By farzyness in forum Excel General
    Replies: 2
    Last Post: 08-26-2010, 10:34 AM
  3. Macro - debug error
    By emptycucumber in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-19-2009, 07:03 AM
  4. debug issue
    By savithrianandh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-13-2007, 09:51 AM
  5. VBA issue, debug
    By ophelia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2006, 05:45 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