Forum Discussion
ADGToreUp
Aug 16, 2022Brass Contributor
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...
- Aug 16, 2022
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 SubMaybe with these lines of code.
OliverScheurich
Aug 16, 2022Gold Contributor
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 SubMaybe with these lines of code.
ADGToreUp
Aug 16, 2022Brass Contributor
Did not think about using Case. Thank you, i will try this.