
Excel Tips and Tricks || Excel VBA Tips
‘Code 1
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range(“D3:H16”)) Is Nothing Or Target.Cells.Count > 1 Then Exit
Sub
Selection.Interior.Color = RGB(0, 255, 0)
Selection.Value = “B”
End Sub
‘Code 2
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Intersect(Target, Range(“D3:H16”)) Is Nothing Or Target.Cells.Count > 1 Then Exit
Sub
Selection.Interior.Color = RGB(255, 255, 255)
Selection.Value = “P”
End Sub
0 responses on "Excel Tips and Tricks || Excel VBA Tips"