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

Hi everyone.Is is possible to set a rowwsource for a combobox
in a userform to : =C9:C63,C68:C110,B117:B166,B173:B187
?????

How?


Thanks in Advance for the hel

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Rowwsourceproblem

forget it.

Multiarea range will not work as rowsource.
Make 1 range with the values you need to have in your form.
Move your originals there and in their original location in the worksheet
add a few simple formulas to look 'm up in the new 'solid' range.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


Stift wrote:

Hi everyone.Is is possible to set a rowwsource for a combobox
in a userform to : =C9:C63,C68:C110,B117:B166,B173:B187
?????

How?


Thanks in Advance for the help


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Rowwsourceproblem

Hi Stift

One way to do it:

Private Sub UserForm_Initialize()
'Leo Heuser, 28-5-2004
Dim Cell As Range
Dim Counter As Long
Dim ListRange As Range
Dim ListRangeValue() As Variant


Set ListRange = _
ActiveSheet.Range("C9:C63,C68:C110,B117:B166,B173: B187")

ReDim ListRangeValue(0 To ListRange.Cells.Count - 1)

For Each Cell In ListRange.Cells
ListRangeValue(Counter) = Cell.Value
Counter = Counter + 1
Next Cell

Me.ComboBox1.List = ListRangeValue

End Sub


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Stift " skrev i en meddelelse
...
Hi everyone.Is is possible to set a rowwsource for a combobox
in a userform to : =C9:C63,C68:C110,B117:B166,B173:B187
?????

How?


Thanks in Advance for the help


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 109
Default Rowwsourceproblem

You could also name the ranges:

In the name box (far left on the formula bar) enter
C9:C63,C68:C110,B117:B166,B173:B187
Press <Enter
While the cells are selected enter "RowSourceRange"
(without quotes) in the name box.

In the sub enter
Range("RowSourceRange") (*With* quotes)
instead of
Range("C9:C63,C68:C110,B117:B166,B173:B187")


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Leo Heuser" skrev i en meddelelse
...
Hi Stift

One way to do it:

Private Sub UserForm_Initialize()
'Leo Heuser, 28-5-2004
Dim Cell As Range
Dim Counter As Long
Dim ListRange As Range
Dim ListRangeValue() As Variant


Set ListRange = _
ActiveSheet.Range("C9:C63,C68:C110,B117:B166,B173: B187")

ReDim ListRangeValue(0 To ListRange.Cells.Count - 1)

For Each Cell In ListRange.Cells
ListRangeValue(Counter) = Cell.Value
Counter = Counter + 1
Next Cell

Me.ComboBox1.List = ListRangeValue

End Sub


--
Best Regards
Leo Heuser

Followup to newsgroup only please.

"Stift " skrev i en meddelelse
...
Hi everyone.Is is possible to set a rowwsource for a combobox
in a userform to : =C9:C63,C68:C110,B117:B166,B173:B187
?????

How?


Thanks in Advance for the help


---
Message posted from http://www.ExcelForum.com/





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Rowwsourceproblem

Stift,
Another way to do it:

Option Explicit
Private Sub UserForm_Initialize()

Dim CL As Range
For Each CL In Range("C9:C63,C68:C110,B117:B166,B173:B187")
ComboBox1.AddItem CL.Value
Next

End Sub


--
Soo Cheon Jheong
Seoul, South Korea
_ _
^ąŻ^
--




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rowwsourceproblem

Got It Fixed Thanks a lot for all your help!!

--
Message posted from http://www.ExcelForum.com

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



All times are GMT +1. The time now is 07:41 PM.

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"