Chris Cred via OfficeKB.com
Guest
Re: Three userform questions
Toppers, thank you once again!
Okay, I finished my project and everything works falwlessly. However, when I
protected the cells that contain formulas, I cannot pass data to the
worksheet. I did, however, unprotect columns A, B, C and D since C and D is
where the data will be passed to and A and B are allowed text changes by the
user.
Any suggestions?
Toppers wrote:
>Chris,
> Some alternatives to Bob's solutions:
>
>(1) Use a button instead of a cell and call macro e.g.
>
>Sub DisplayForm()
>UserForm1.Show
>End Sub
>
>Go to FORMS toolbar, select Button control and then "Assign Macro"; in my
>example "DisplayForm"
>
>2. Combobox3 has data from non-contiguous cells
>
>Private Sub UserForm_Initialize()
>
>ComboBox1.RowSource = "Sheet1!a2:a10"
>' add data from named range
>ComboBox2.RowSource = "Data2"
>' add data fron non-contiguous cells ......
>For Each cell In Range("c2:c4, c7:c10")
> ComboBox3.AddItem cell.Value
>Next cell
>End Sub
>
>3. Check all CBs for data entered; change Errmsg array as required.
>
>Private Sub CommandButton1_Click()
>
>Dim ErrorFound As Boolean
>
>Errmsg = Array("Please enter course number", "Please enter ...combobox2..",
>"Please Enter ..combobox3.")
>
>ErrorFound = False
>' Check if there has been an entry in each combobox
>For i = 1 To 3
>If Controls("combobox" & i).ListIndex = -1 Then
> MsgBox Errmsg(i - 1)
> ErrorFound = True
>End If
>Next i
>
>If ErrorFound Then Exit Sub
>
>'..continue ...
>End Sub
>
>> > Hello Everyone,
>> >
>[quoted text clipped - 52 lines]
>> Trim(Me.ComboBox2.Value) = "" And _
>> Trim(Me.ComboBox3.Value) = "" Then
--
Message posted via http://www.officekb.com
Bookmarks