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: 2
Default Creating first ever userform but not going how I wanted

I am in the process of creating my first userform. I am having much
difficulty though as the information in the Office help is not pertinent to
what I am trying to do.

I am looking to find the flaws in these codes:

Private Sub UserForm_Initialize()
cbxData.Enabled = False
cmdOK = False
End Sub

Private Sub cbxFilter_Change()
cbxData.Enabled = True
cmdOK = False

Dim Department() As Variant
Dim Rank() As Variant
Dim Sex() As Variant

If cbxFilter.Value = "DEPARTMENT" Then
cbxData.RowSource = "Department"

'Department = VBA.Array("Department", _
"Accounting", _
"Finance", _
"Management")

ElseIf cbxFilter.Value = "RANK" Then
cbxData.RowSource = "Rank"

'Rank = VBA.Array("Rank", _
"Assistant", _
"Associate", _
"Full", _
"Instructor")

ElseIf cbxFilter.Value = "SEX" Then
cbxData.RowSource = "Sex"

'Sex = VBA.Array("Sex", _
"F", _
"M")

End If

End Sub

Private Sub cmdCancel_Click()
Unload SelectCriteria
End Sub

Private Sub cmdOK_Click()

If cbxFilter.Value = "Department" Then
Load cbxData.Value = Range("c2")
ElseIf cbxFilter.Value = "Rank" Then
Load cbxData.Value = Range("d2")
ElseIf cbxFilter.Value = "Sex" Then
Load cbxData.Value = Range("f2")

End If

Me.Hide
End Sub


If I can get over this problem then I hopefully can activate my userform can
be run smoothly.

Thank you in advance for your help.
 
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
Creating a lookup in a userform BJ&theBear Excel Discussion (Misc queries) 4 March 17th 10 06:51 PM
Creating a Userform using code trini Excel Programming 1 March 5th 05 11:15 PM
Creating Temporary Userform with checkboxes [email protected] Excel Programming 1 February 13th 05 01:39 PM
Creating a Data Entry Userform spurtniq[_8_] Excel Programming 1 January 8th 04 05:48 AM
Need help creating a userform with optionbuttons TB[_2_] Excel Programming 2 July 21st 03 02:16 PM


All times are GMT +1. The time now is 09:42 AM.

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

About Us

"It's about Microsoft Excel"