LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Using a named range as a source for a combobox on a userform

I already have an auto-expanding named range (per Steve Bullen) to grab user
input from a worksheet. When the user clicks a toolbar button, it brings up
my userform and I'd like to use the named range to populate a set of
comboboxes. I thought I could replace the rowsource property with the named
range, but so far I've been unsuccessful- probably a simple syntax problem
(it has been a while since I've done Excel userform programming). I'm using
the loop below because I actually need to load up 6 comboboxes with the same
source.

Any assistance would be greatly appreciated- using XL2003 on WinXP.
Thank you!
Keith

MyNames = OFFSET(Lists!$A$2,0,0,COUNTA(Lists!$A$2:$A$1000),1 )

Relvant code:

Sub UF1Load()
Dim Ctl As Control
For Each Ctl In UF1.Controls
TempName = Left(Ctl.Name, 3)
If TempName = "txt" Then
'<snip
ElseIf TempName = cmb Then
'Ctl.List = MyNames
Ctl.RowSource = MyNames (or Sheet1.MyNames)
End If
Next

UF1.Show

End Sub


 
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
Using a named range as a data source for a chart MichaelR Charts and Charting in Excel 4 June 16th 08 04:15 AM
Using a named range as a data source for a chart MichaelR Excel Worksheet Functions 0 June 15th 08 01:34 AM
Using a Named Range for Data Source In A Chart JoeP Charts and Charting in Excel 2 April 25th 07 02:33 AM
Use named range to fill Userform combobox XL2003? Keith Excel Programming 1 January 5th 07 04:11 PM
Combobox and named range as source Matt Jensen Excel Programming 3 December 30th 04 02:47 PM


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