AnsweredAssumed Answered

Convert Label (string) to Integer in ProcessBook using VBA

Question asked by Mikeconnors on Jun 9, 2016
Latest reply on Jun 10, 2016 by Kenji Hashimoto

Hi All,

 

I'm currently trying to multi-state a label in a userform so that when it reaches a certain value it flashes. The trouble I'm having is converting the label to an integer. this is what I have so far and it doesn't work

the rest of the code works fine its just the converting that keeps giving me the error

 

Private Sub FlashLabel()

Dim CompressionRatio As Integer
CompressionRatio = CInt(LabelForeColor.Caption)

    Do While Flash = True
   
        If   Me.LabelCompRat.ForeColor = vbBlack And CompressionRatio > 30 Then
             Me.LabelCompRat.ForeColor = vbRed
           
       Else
             Me.LabelCompRat.ForeColor = vbBlack
                  
        End If
        Sleep (100)
        DoEvents
              
    Loop
End Sub

 

Thanks,

Michael

Outcomes