Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Option group and Combobox

I have a userform with 2 option checks and a combo box.
each option check when checked takes put the focus of the
userform onto a sheet within an excel workbook.
each sheet has multiple columns filled with data.
The first column in each is the reference column.

When I click on one of the options how do I get the combo
box to display in it's dropdown list the references in
the fist column of the selected sheet?

The sheets are not visable to the users so the combo box
must display the reference from the correct sheet.

This has really been bugging me....
Any help would be great.
Thanks
Andy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Option group and Combobox

Private Sub OptionButton1_Click()
if optionbutton1.Value Then
With Worksheets("Sheet1")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End(xlup))
End with
Combobox1.rowsource = ""
Combobox1.List = rng.Value
end if
End Sub


Private Sub OptionButton2_Click()
if optionbutton2.Value Then
With Worksheets("Sheet2")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End(xlup))
End with
Combobox1.rowsource = ""
Combobox1.List = rng.Value
end if
End Sub


If they are really checkboxes, just change the names in the routines.

--
Regards,
Tom Ogilvy


Andy wrote in message
...
I have a userform with 2 option checks and a combo box.
each option check when checked takes put the focus of the
userform onto a sheet within an excel workbook.
each sheet has multiple columns filled with data.
The first column in each is the reference column.

When I click on one of the options how do I get the combo
box to display in it's dropdown list the references in
the fist column of the selected sheet?

The sheets are not visable to the users so the combo box
must display the reference from the correct sheet.

This has really been bugging me....
Any help would be great.
Thanks
Andy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Option group and Combobox

Thanks for the help.

Andy
-----Original Message-----
Private Sub OptionButton1_Click()
if optionbutton1.Value Then
With Worksheets("Sheet1")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End

(xlup))
End with
Combobox1.rowsource = ""
Combobox1.List = rng.Value
end if
End Sub


Private Sub OptionButton2_Click()
if optionbutton2.Value Then
With Worksheets("Sheet2")
set rng = .Range(.Cells(1,1),.Cells(rows.count,1).End

(xlup))
End with
Combobox1.rowsource = ""
Combobox1.List = rng.Value
end if
End Sub


If they are really checkboxes, just change the names in

the routines.

--
Regards,
Tom Ogilvy


Andy wrote in

message
...
I have a userform with 2 option checks and a combo box.
each option check when checked takes put the focus of

the
userform onto a sheet within an excel workbook.
each sheet has multiple columns filled with data.
The first column in each is the reference column.

When I click on one of the options how do I get the

combo
box to display in it's dropdown list the references in
the fist column of the selected sheet?

The sheets are not visable to the users so the combo box
must display the reference from the correct sheet.

This has really been bugging me....
Any help would be great.
Thanks
Andy



.

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
Is there any option to group Worksheets? Indra Pal Singh Excel Discussion (Misc queries) 1 March 8th 10 08:39 AM
option buttons / group box texas2001 Excel Discussion (Misc queries) 1 December 17th 09 06:43 PM
Option Group in excel Daoud Fakhry Excel Discussion (Misc queries) 4 April 22nd 07 03:12 PM
Option Buttons in Group Box JAMES T. Excel Discussion (Misc queries) 4 March 22nd 05 08:59 PM
Combobox populating based on Option Button Todd Huttenstine[_2_] Excel Programming 7 November 9th 03 10:18 PM


All times are GMT +1. The time now is 09:47 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"