(Solved) – How can I run multiple VBA code on the same worksheet

  • by
(solved)-–-how-can-i-run-multiple-vba-code-on-the-same-worksheet

I am currently running the code below:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    Cancel = True
    Worksheet_SelectionChange Target

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    With Target
        If Intersect(.Cells, Range("E4:K120")) Is Nothing Or .Count > 1 Then Exit Sub
        Select Case .Value
        Case ""
            .Interior.ColorIndex = 3
        Case 1
            .Interior.ColorIndex = xlNone
            .Value = vbNullString
        Exit Sub
        Case Else
        Exit Sub
        End Select
            .Value = .Value   1
    End With

End Sub

I now need to run a similar code for a different cell range on the same worksheet. I need the code to cycle through 4 different colours and text when cells within the N column are clicked. I am not a coder so this is way above my paygrade. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *