I have a spreadsheet in which I want to perform a BeforeDoubleClick command on. I have two ranges which are M3 to M49 (range 1) and M50 to M250 (Range2). In range one when i perform a doubleclick I want the contents of the cell to change from "NOT CHECKED" to "CHECKED" and the cell colour to change from red to green (this command already works), the problem arises with the second range, which I want it to do the same as the first range but in this case I also want it to hide the entire row. I have managed to write the code for these to work independently my difficulty is getting them to work together.
The code I have so far is:
Any guidance would be gratefully appreciated.
My thanks in advance
The code I have so far is:
Code:
Private Sub Worksheet_BeforeDoubleclick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range("$M$3:$M$49")) Is Nothing Then Exit Sub
Select Case Target
Case "NOT CHECKED"
Target = "CHECKED"
Target.Interior.ColorIndex = 4
Case Else
Target = "NOT CHECKED"
Target.Interior.ColorIndex = 3
If Intersect(Target, Range("$M$50:$M$250")) Is Nothing Then Exit Sub
Select Case Target
Case "NOT CHECKED"
Target = "CHECKED"
Target.Interior.ColorIndex = 4
Target.EntireRow.Hidden = True
Case Else
Target = "NOT CHECKED"
Target.Interior.ColorIndex = 3
End Select
End Select
End Sub
My thanks in advance
Last edited by a moderator: