View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default ComboBox to show a range

Private Sub Userform_Initialize()
cbo_PYear.rowSource = "Year"
cbo_CYear.RowSource = "Year"
cbo_State.RowSource = "States"
End Sub

Private Sub cbOK_Click()
Range("PYear") = cbo_PYear.Value
Range("CYear") = cbo_CYear.Value
Range("State") = cbo_State.Value
UnLoad Me
End Sub

Private Sub cbCancel_Click()
Unload me
End Sub

Put commandbuttons
cbOK
cbCancel

on the userform

--
Regards,
Tom Ogilvy


"TimT" wrote in message
...
I'm trying to set up a userform with three comboboxes that would each be
populated by one of two range names.
cbo_PYear by "Year"
cbo_CYear by "Year"
cbo_State by "States"

Upon clicking a button to start the spread sheet I need the form to be
visible and to collect the user information and when the user clicks OK

for
it to send the values to another range name.
Does anyone know how I would set the code up for this?

Private Sub Userform_Go()

End Sub