K
kirkm
The following -
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Dim rng As Range
Dim MyLastCol As Integer
Dim MyLastRow As String
Dim rows, p
Set rng =
Worksheets("Sheet1").Range("A1").SpecialCells(xlCellTypeLastCell)
MyLastRow = rng.Row
rows = "A1:A" & MyLastRow
If Not Intersect(Target, Range(rows)) Is Nothing Then
Cancel = True
p = InputBox("Enter Year", , "1952")
If Len(p) = 4 Then
Select Case p
Case 1952 To 1974
Stop
End Select
End If
End If
End Sub
.... is meant to display an input box.
Sometimes though, it will just select (move to) the first or last cell
in the column. I can't figure out why. Does anyone know?
Thanks - Kirk
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel
As Boolean)
Dim rng As Range
Dim MyLastCol As Integer
Dim MyLastRow As String
Dim rows, p
Set rng =
Worksheets("Sheet1").Range("A1").SpecialCells(xlCellTypeLastCell)
MyLastRow = rng.Row
rows = "A1:A" & MyLastRow
If Not Intersect(Target, Range(rows)) Is Nothing Then
Cancel = True
p = InputBox("Enter Year", , "1952")
If Len(p) = 4 Then
Select Case p
Case 1952 To 1974
Stop
End Select
End If
End If
End Sub
.... is meant to display an input box.
Sometimes though, it will just select (move to) the first or last cell
in the column. I can't figure out why. Does anyone know?
Thanks - Kirk