Forum Discussion

ADGToreUp's avatar
ADGToreUp
Brass Contributor
Aug 16, 2022
Solved

Compile Error: End if without Block if. If Loop Function.

Hello Everybody,   I have a loop function while using the "Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)" function.  I have a spread sheet that loops through wing dings, wit...
  • OliverScheurich's avatar
    Aug 16, 2022

    ADGToreUp 

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    
    If Not Intersect(Target, Range("F11:L43")) Is Nothing Then
    
    Select Case Target.Value
    
    Case Is = "/"
    Target.Value = "$"
    
    Case Is = "O"
    Target.Value = "/"
    
    Case Is = "P"
    Target.Value = "O"
    
    Case Is = "$"
    Target.Value = "P"
    
    Case Is = Empty
    Target.Value = "/"
    
    End Select
    
    ActiveSheet.Range("A22").Select
    
    End If
    
    End Sub

    Maybe with these lines of code.

Resources