New to VBA - I have the code for two formulas , however I'd like to have them merged for a bingo template if anybody could please help with the code. A brief description of what im trying to achieve.
The first code - when i double click on a cell the background of the cell turns white.
Second code - when i double click on that cell that has turned white the number in that cell copies to another cell.
Thanks, below are the two formulas i'am hoping to merge.
The first code - when i double click on a cell the background of the cell turns white.
Second code - when i double click on that cell that has turned white the number in that cell copies to another cell.
Thanks, below are the two formulas i'am hoping to merge.
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Target.Interior.Color = vbWhite
End Sub
VBA Code:
Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
Target.Interior.Color = vbGreen
End Sub
VBA Code:
Private Sub Worksheet_AfterDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("A4:I14")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Range("J4").Value = Target.Value
End If
End Sub
VBA Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Not Intersect(Target, Range("A4:I14")) Is Nothing Then
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Range("J4").Value = Target.Value
End If
End Sub
Last edited by a moderator: