LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 156
Default Code question


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(xlCe llTypeLastCell)
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code question peyman Excel Discussion (Misc queries) 5 February 5th 09 12:04 AM
vb code question Stan Excel Discussion (Misc queries) 0 April 28th 08 04:43 PM
question on VB code peyman Excel Discussion (Misc queries) 6 October 22nd 07 11:47 PM
VBA code question JEV Excel Discussion (Misc queries) 2 March 1st 07 06:02 PM
Code Question Ronbo Excel Programming 3 September 23rd 05 09:33 PM


All times are GMT +1. The time now is 06:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"