Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi -
I am new to using 'custom dialog boxes'. I am trying to take some data from my user form once I have hit the OK button on the userform and bring those entries back to my main sub where I will use this data to run the rest of my code. I am able to get the form working but the userform inputs seem to be local to the code that I have for the form but I haven't been able to get the variables back to my main code section. PS, My userform is in my personal.xls and I will be using the data to affect a separate workbook. Thanks, Chet Code I have so far.... '///////////////////////CODE IN THE USERFORM/////////////////////////////////////// Private Sub CommandButton2_Click() End Sub Private Sub OKButton_Click_Click() Msg = "You selected Item # " Msg = Msg & ListBox1.ListIndex Msg = Msg & vbCrLf Msg = Msg & ListBox1.Value LocID = ListBox1.Value MsgBox Msg Unload UserForm1 End Sub '/////////////////MAIN PROGRAM CODE//////////////////////////////// Sub TOOLBAR_POSTAL_BYP_MIX_BREAKOUT_vsn2() With UserForm1.ListBox1 .AddItem "SFO" .AddItem "OAK" .AddItem "SJC" End With With UserForm1.ListBox2 .AddItem "ORIG" .AddItem "DEST" End With With UserForm1.ListBox3 .AddItem "Weekday" .AddItem "Saturday" .AddItem "Sunday" End With UserForm1.ListBox1.ListIndex = 0 UserForm1.Show 'the rest of the code follows here unrelated to the data / form entry////////// Application.ScreenUpdating = False Direction = InputBox("Input DEST or ORIG") Direction = UCase(Direction) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Main Form - copy exact data from multiple worksheets with live lin | Excel Worksheet Functions | |||
Auto entry of data based on entry of text in another column or fie | Excel Discussion (Misc queries) | |||
Filter Excel Pivot, based on user entry form | Excel Discussion (Misc queries) | |||
Data Entry Form (similar to default Excel DataForm) | Excel Programming | |||
2nd Form deselects list box items on main form | Excel Programming |