So if this..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("X1")
If .Value = Empty Then
Application.EnableEvents = False
.Select
MsgBox "Please enter the number of pages required."
Application.EnableEvents = True
End If
End With
End Sub
..plus this..
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A14,G14,L14,Q14,U14,A16,A18")) Is Nothing Then
If Target.Value = "P" Then
Target.Value = ""
Else
Target.Value = "P"
End If
Range("G12").Select ' or whatever cell you want selected after a click.
End If
End Sub
..equals this:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rCell As Range
With Range(tCell)
If .Value = Empty Then
Application.EnableEvents = False
.Select
MsgBox "Please enter the number of pages required."
Application.EnableEvents = True
End If
End With
If Not Intersect(Target, Range("A14,G14,L14,Q14,U14,A16,A18")) Is Nothing Then
For Each rCell In Intersect(Target, Range("A14,G14,L14,Q14,U14,A16,A18")).Cells
If rCell.Value = "P" Then
rCell.Value = ""
Else
rCell.Value = "P"
End If
Next rCell
Range("G12").Select ' or whatever cell you want selected after a click.
End If
End Sub
..then would this..
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("X1")
If .Value = Empty Then
Application.EnableEvents = False
.Select
MsgBox "Please enter the number of pages required."
Application.EnableEvents = True
End If
End With
End Sub
..plus this..
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Select Case Target.Address
Case "$A$14", "$G$14", "$L$14"
If Target = "P" Then Target = "" Else Target = "P"
End Select
End Sub
..equal.. this?
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim rCell As Range
With Range(tCell)
If .Value = Empty Then
Application.EnableEvents = False
.Select
MsgBox "Please enter the number of pages required."
Application.EnableEvents = True
End If
End With
Select Case Target.Address
Case "$A$14", "$G$14", "$L$14"
If Target = "P" Then Target = "" Else Target = "P"
End Select
End If
End Sub
Bookmarks