How do I debug a message if another message prevents me from doing so ?!?

vodkasoda

Board Regular
Joined
Aug 12, 2004
Messages
86
OK, a vague enough question I am sure, but this is my predicament :

If I run my VBA program I get an error message "Argument Not Optional" ... but if I debug I get the message "Can't execute code in break mode" !!

My main VBA is in Thisworkbook and the new code is as follows :

Code:
    Range("B11").Activate
    
    Set myRange1 = Range("B" & (10 + mySession))
    Set myRange2 = Range("H" & (10 + mySession))
    
    If myRange1 = "" Then
        Call StartBlink(myRange2)
    End If
        
    Application.ScreenUpdating = True
The Module Blinking_Text contains the following code (this is adapted from code I have found online, I am not sure what this RunWhen stuff does) :

Code:
Option Explicit
Public RunWhen As Double
 
Sub StartBlink(BlinkCell As Range)
    
    If BlinkCell.Font.ColorIndex = 1 Then
        BlinkCell.Font.ColorIndex = 2
    Else
        BlinkCell.Font.ColorIndex = 1
    End If
    
    RunWhen = Now + TimeSerial(0, 0, 1)
    
    Application.OnTime RunWhen, "StartBlink", , True
    
End Sub
 
Sub StopBlink(BlinkCell As Range)

    BlinkCell.Font.ColorIndex = xlAutomatic
    
    Application.OnTime RunWhen, "StartBlink", , False
    
End Sub
Any ideas ?
 

Forum statistics

Threads
1,081,425
Messages
5,358,604
Members
400,505
Latest member
JacquiT

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top