Hello,
I need to add this code from Sheet 2 of my workbook:
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
..to this code on Sheet 1 of the same workbook:
Option Explicit
Const tCell As String = "X1" ' Set this to the individual sheet cell
Private Sub Worksheet_Activate()
nPages = setPages(Me, tCell)
End Sub
Private Sub Worksheet_Calculate()
nPages = setPages(Me, tCell)
End Sub
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
What is the correct way of doing this so that both SelectionChange events will work? I'm trying to learn how.
Bookmarks