selection change is a workSHEET event, and should be in the worksheet for
which you want to trap the event. Sheet Selection Change is the workbook
event, and this should be in the code page for ThisWorkbook.
HINT: in the code module for the worksheet, your objects are Worksheet and
general, for ThisWorkbook, the objects are Workbook and general
"Patrick C. Simonds" wrote:
> I placed this code under ThisWorkbook but it does not run. If I place the
> code on a worksheet it runs fine for that worksheet. My workbook has over 90
> worksheets. I was hoping not to have to attach this code to each worksheet.
> Am I missing something?
>
>
>
> Option Explicit
> Private Sub Worksheet_SelectionChange(ByVal Target As Excel.range)
>
> If Not Application.Intersect(Target, range("H11:H22")) Is Nothing Then
> VacationTaken.Show
>
>
> End Sub
>
>
|