I have the below code and it works fine, but I am looking to do 4 things with it and am a little lost
THanks in Advance
- Make the intersect Target Range B3:B64 AND E3:E64 AND H3:H64 AND K3:K64, instead of all cells in all the columns of the range
- consolidate the code by making the sections a range instead of seperate if statements to place target value(so first range would be Q12:Q17)
- Add additional ranges in addition to Q12:Q17 (i.e. Q24:Q29, Q34:Q39)
- Anytime I click on a cell in any of the defined ranges in column Q, change the contents of the cell to "Pick a Golfer"
THanks in Advance
VBA Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Range("B3:K64")) Is Nothing Then Exit Sub
If Range("q12").Value = "Pick a Golfer" Then
Range("q12").Value = Target.Value
Else:
If Range("q13") = "Pick a Golfer" Then
Range("q13").Value = Target.Value
Else:
If Range("q14") = "Pick a Golfer" Then
Range("q14").Value = Target.Value
Else:
If Range("q15") = "Pick a Golfer" Then
Range("q15").Value = Target.Value
Else:
If Range("q16") = "Pick a Golfer" Then
Range("q16").Value = Target.Value
Else:
If Range("q17") = "Pick a Golfer" Then
Range("q17").Value = Target.Value
Else: Exit Sub
End If
End If
End If
End If
End If
End If
End Sub