Three userform questions
"Chris Cred via OfficeKB.com" <u17747@uwe wrote in message
news:5abb1659b7359@uwe...
Hello Everyone,
I just created a userform and it works great thanks to Toppers help. I
just
have two questions that might be simple for some of you to answer.
1: Is there a way to create a link in a cell that will launch the userform
when the user is ready to use it? If so, could I get some info on that?
I'm
stuck n how to let the user interact with it.
This works if you double-click cell H10
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Not Intersect(Target, Range("H10")) Is Nothing Then
userform1.Show
End If
End Sub
'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code
2: In one of my comboboxs I have a range using the RowSource property. Is
there a way to eliminate a few of the cells in that range so they don't
appear in the combobox? FYI, the ones I want to eliminate from the combox
still need to appear on the worksheet thought. They are spaces and
sections
titles.
The only way would be to extract the required data from the original range,
maybe using Advanced Filter, and point the combo at that new range.
3. Using the code below I have it setup where combobox1 must have data in
it
for the user to click the "Add" button. What would I have to alter in this
code so combobox 2 and combobox3 also checks for a course number before
they
add data?
Thanks in advance,
Chris
Code:
Private Sub cmdAdd_Click()
rowno = Columns(1).Find(Trim(ComboBox1.Value)).Row
Range("C" & rowno).End(xlToLeft).Offset(0, 1) = ComboBox2.Value
Range("D" & rowno).End(xlToLeft).Offset(0, 1) = ComboBox3.Value
Isn't that obvious?
If Trim(Me.ComboBox1.Value) = "" And _
Trim(Me.ComboBox2.Value) = "" And _
Trim(Me.ComboBox3.Value) = "" Then
|