Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Activating (or calling on) a Form 1

Status
Not open for further replies.

futbuk

Programmer
Sep 17, 2002
12
CA
I currently have an excel worksheet set up to call on a calendar form everytime the user clicks cell B2 as follows:

This code is in the "ThisWorkbook"

Private Sub Workbook_Open()
Sheets("INPUT").OnDoubleClick = "Input_Form"
End Sub

This is the module

Sub Input_Form()
Dim rowval As String
Dim colval As String
colval = Selection.Column
rowval = Selection.Row
If colval = 2 And rowval = 2 Then
frmCalendar.Show
End If
End Sub

I would like to change from using just 1 cell activating the form (by doubleclicking cell B2) to a range of cells that whenever one of the single cells in that particular range (in my case j4:k500) is double clicked the form appears. Any thoughts?
 
j4:k500
If colval >= 10 And colval <= 11 And rowval >= 4 And rowval <= 500 Then
frmCalendar.Show
End If

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Dim rowval and colval as numbers, otherwise:
[!]Dim str1 As String, str2 As String
str1 = 5
str2 = 11
MsgBox str1 > str2[/!]

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top