Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Multicolumn Listbox with variable range

I'm trying to create a listbox in a user form (C_Panel) that is multicolumn,
and references a two column but variable row range (A2 to B?). Can someone
point me to how to do this.

Also how do I get the listbox to automatically reflect any changes to the
range or does it do it automatically?

Using Excel 2000

Thanks
David



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multicolumn Listbox with variable range

If you use the rowsource property it should update each time the sheet
calculates or a cel is edited.

Private Sub Userform_Initialize()
Dim rng as Range
Listbox1.ColumnCount = 2
With Worksheets("Sheet1")
set rng = .Range(.Range("A2"), _
.Cells(rows.count,1).End(xlup)) _
.Resize(,2)
End With
ListBox1.RowSource = rng.Address(External:=True)
End Sub

--
Regards,
Tom Ogilvy




"dht" wrote in message
...
I'm trying to create a listbox in a user form (C_Panel) that is

multicolumn,
and references a two column but variable row range (A2 to B?). Can someone
point me to how to do this.

Also how do I get the listbox to automatically reflect any changes to the
range or does it do it automatically?

Using Excel 2000

Thanks
David





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Multicolumn Listbox with variable range

Thats great. Thanks very much. Are there any good online resources I can
look at so that I can try those for the future.

Thanks


"Tom Ogilvy" wrote in message
...
If you use the rowsource property it should update each time the sheet
calculates or a cel is edited.

Private Sub Userform_Initialize()
Dim rng as Range
Listbox1.ColumnCount = 2
With Worksheets("Sheet1")
set rng = .Range(.Range("A2"), _
.Cells(rows.count,1).End(xlup)) _
.Resize(,2)
End With
ListBox1.RowSource = rng.Address(External:=True)
End Sub

--
Regards,
Tom Ogilvy




"dht" wrote in message
...
I'm trying to create a listbox in a user form (C_Panel) that is

multicolumn,
and references a two column but variable row range (A2 to B?). Can

someone
point me to how to do this.

Also how do I get the listbox to automatically reflect any changes to

the
range or does it do it automatically?

Using Excel 2000

Thanks
David







  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Multicolumn Listbox with variable range

dht

Here's some pages from my site that discuss listboxes

http://search.atomz.com/search/?sp-q...p-f=ISO-8859-1


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

dht wrote:
Thats great. Thanks very much. Are there any good online resources I
can look at so that I can try those for the future.

Thanks


"Tom Ogilvy" wrote in message
...
If you use the rowsource property it should update each time the
sheet calculates or a cel is edited.

Private Sub Userform_Initialize()
Dim rng as Range
Listbox1.ColumnCount = 2
With Worksheets("Sheet1")
set rng = .Range(.Range("A2"), _
.Cells(rows.count,1).End(xlup)) _
.Resize(,2)
End With
ListBox1.RowSource = rng.Address(External:=True)
End Sub

--
Regards,
Tom Ogilvy




"dht" wrote in message
...
I'm trying to create a listbox in a user form (C_Panel) that is
multicolumn, and references a two column but variable row range (A2
to B?). Can someone point me to how to do this.

Also how do I get the listbox to automatically reflect any changes
to the range or does it do it automatically?

Using Excel 2000

Thanks
David



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Multicolumn Listbox with variable range

Dick gave you an excellent reference.

This group is a good place to look as well.

Here are some additional sources: (listboxes are documented with all the
msforms 2.0 controls and userforms - so each article is not specifically
aimed at listboxes alone).

http://support.microsoft.com/default.aspx?kbid=161514
XL97: How to Use a UserForm for Entering Data

http://support.microsoft.com/default.aspx?kbid=213749
XL2000: How to Use a UserForm for Entering Data

http://www.microsoft.com/ExcelDev/Articles/sxs11pt1.htm
Lesson 11: Creating a Custom Form
Excerpted from Microsoft® Excel 97 Visual Basic® Step by Step.
http://j-walk.com/ss/excel/tips/tip84.htm

http://support.microsoft.com/default...b;en-us;829070
How to use Visual Basic for Applications examples to control UserForms in
Microsoft Excel

Here are some other sources of information:


http://support.microsoft.com/?id=168067
File Title: Microsoft(R) Visual Basic(R) for Applications Examples for
Controlling UserForms in Microsoft Excel 97
File Name: WE1163.EXE
File Size: 161742 bytes
File Date: 05/08/97
Keywords: kbfile
Description: This Application Note is an introduction to manipulating
UserForms in Microsoft Excel 97. It includes examples and Microsoft Visual
Basic for Applications macros that show you how to take advantage of the
capabilities of UserForms and use each of the ActiveX controls that are
available for UserForms

Peter Aiken Articles:
Part I
http://msdn.microsoft.com/library/en...FormsPartI.asp
Part II
http://msdn.microsoft.com/library/en...ormsPartII.asp


http://support.microsoft.com/default...;EN-US;Q168067

http://support.microsoft.com/support.../q213/7/32.asp
XL2000: Using the LoadPicture Function with an Image Control

--
Regards,
Tom Ogilvy

"Dick Kusleika" wrote in message
...
dht

Here's some pages from my site that discuss listboxes


http://search.atomz.com/search/?sp-q...p-f=ISO-8859-1


--
Dick Kusleika
Excel MVP
Daily Dose of Excel
www.dicks-blog.com

dht wrote:
Thats great. Thanks very much. Are there any good online resources I
can look at so that I can try those for the future.

Thanks


"Tom Ogilvy" wrote in message
...
If you use the rowsource property it should update each time the
sheet calculates or a cel is edited.

Private Sub Userform_Initialize()
Dim rng as Range
Listbox1.ColumnCount = 2
With Worksheets("Sheet1")
set rng = .Range(.Range("A2"), _
.Cells(rows.count,1).End(xlup)) _
.Resize(,2)
End With
ListBox1.RowSource = rng.Address(External:=True)
End Sub

--
Regards,
Tom Ogilvy




"dht" wrote in message
...
I'm trying to create a listbox in a user form (C_Panel) that is
multicolumn, and references a two column but variable row range (A2
to B?). Can someone point me to how to do this.

Also how do I get the listbox to automatically reflect any changes
to the range or does it do it automatically?

Using Excel 2000

Thanks
David







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
multicolumn listbox move or value set Andrew Smith Excel Programming 3 August 25th 04 05:18 AM
Reordering with Multicolumn Listbox asmenut Excel Programming 2 August 17th 04 01:53 PM
Multicolumn Listbox and ordinary listbox Ron_D Excel Programming 0 June 4th 04 08:56 PM
multicolumn Listbox and textalignment John Holland Excel Programming 3 September 11th 03 01:45 AM
Values in a MultiColumn Listbox Tom Ogilvy Excel Programming 5 September 5th 03 08:30 PM


All times are GMT +1. The time now is 01:38 PM.

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"