Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default List box Setup from Varying 1d Array

Hi

I need to create a listbox1 within a userform to select one name from a list
of names.

The list of names varies in length from 3 to 60 people.

The list of names starts at B2 and goes down (and varies in number)

Can I get it to default to the 'users' name (from ToolsOptions...General)?

Do I have to set up a dynamic 1d array when I call up the userform?

Kind regards

--
Andrew 'The Ox' Heath
Brisbane, QLD
Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default List box Setup from Varying 1d Array

Private Sub Userform_Initialize()
Dim rng as Range
with worksheets("Data")
set rng = .Range(.Range("B2"),.Range("B2").End(xldown))
End with
Listbox1.RowSource = rng.Address(external:=True)
listbox1.Value = Application.UserName

End Sub

--
Regards,
Tom Ogilvy

"Andrew Heath" (delete) wrote in message
...
Hi

I need to create a listbox1 within a userform to select one name from a

list
of names.

The list of names varies in length from 3 to 60 people.

The list of names starts at B2 and goes down (and varies in number)

Can I get it to default to the 'users' name (from

ToolsOptions...General)?

Do I have to set up a dynamic 1d array when I call up the userform?

Kind regards

--
Andrew 'The Ox' Heath
Brisbane, QLD
Australia



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
Create List sourced from Multiple sheets of varying lengths desertSol New Users to Excel 1 October 21st 09 10:05 PM
Array for varying 2 out of many input variables for complicated fx MontyCR Excel Discussion (Misc queries) 0 April 10th 09 07:13 PM
using VB to read in a column of values of varying length into an array [email protected] Excel Worksheet Functions 2 June 12th 06 10:08 PM
How: List in col D whichever number greater; B4 or varying # in Co Building Model Sailboats is great fun Excel Discussion (Misc queries) 3 February 9th 06 12:41 AM
Trying to generate a quantity from a list of doors with varying at JDEllis Excel Discussion (Misc queries) 0 December 9th 05 10:08 PM


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