Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default ComboBox to show a range

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 69
Default ComboBox to show a range

Works excellent!
Thanks Tom!

"Tom Ogilvy" wrote:

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




Reply
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
select from combobox and show a price in textbox gem New Users to Excel 1 June 14th 06 11:37 AM
Selecting any cell in a column I want my ComboBox to show. How? ABP MLundqvist Excel Discussion (Misc queries) 4 March 1st 06 01:15 PM
Show Filename Only in ComboBox Pulldown D.Parker Excel Discussion (Misc queries) 16 June 29th 05 02:46 PM
Show one range in a combobox and write the 2nd range! Kevin Excel Programming 1 October 17th 03 05:52 AM
ComboBox.Value To Range Hamilton R. Romano Excel Programming 0 September 9th 03 05:28 PM


All times are GMT +1. The time now is 11:16 AM.

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

About Us

"It's about Microsoft Excel"