Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Write a Listbox list to a dynamic range

I am looking for some code to write the user selections from a list box to a
dynamic worksheet range
something like
range ("rng1")= listbox1.list
and then resize the range dependent on the lengh of the list (list is 1
Column)
--
Fuzzy logix
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Write a Listbox list to a dynamic range

Dim v as Variant
v = Listbox1.List
range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1).Value = v

--
Regards,
Tom Ogilvy

"blayne" wrote in message
...
I am looking for some code to write the user selections from a list box to

a
dynamic worksheet range
something like
range ("rng1")= listbox1.list
and then resize the range dependent on the lengh of the list (list is 1
Column)
--
Fuzzy logix



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Write a Listbox list to a dynamic range

Thank you Tom,

--
Fuzzy logix


"Tom Ogilvy" wrote:

Dim v as Variant
v = Listbox1.List
range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1).Value = v

--
Regards,
Tom Ogilvy

"blayne" wrote in message
...
I am looking for some code to write the user selections from a list box to

a
dynamic worksheet range
something like
range ("rng1")= listbox1.list
and then resize the range dependent on the lengh of the list (list is 1
Column)
--
Fuzzy logix




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Write a Listbox list to a dynamic range

Works Fine
rng1 is a named range & I want to include the new information in the named
range
--
Fuzzy logix


"Tom Ogilvy" wrote:

Dim v as Variant
v = Listbox1.List
range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1).Value = v

--
Regards,
Tom Ogilvy

"blayne" wrote in message
...
I am looking for some code to write the user selections from a list box to

a
dynamic worksheet range
something like
range ("rng1")= listbox1.list
and then resize the range dependent on the lengh of the list (list is 1
Column)
--
Fuzzy logix




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Write a Listbox list to a dynamic range

Dim v as Variant
Dim rng as Range
v = Listbox1.List
set rng = range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1)
rng.Value = v
rng.Name = "rng1"

--
Regards,
Tom Ogilvy


"blayne" wrote in message
...
Works Fine
rng1 is a named range & I want to include the new information in the named
range
--
Fuzzy logix


"Tom Ogilvy" wrote:

Dim v as Variant
v = Listbox1.List
range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1).Value = v

--
Regards,
Tom Ogilvy

"blayne" wrote in message
...
I am looking for some code to write the user selections from a list

box to
a
dynamic worksheet range
something like
range ("rng1")= listbox1.list
and then resize the range dependent on the lengh of the list (list is

1
Column)
--
Fuzzy logix








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Write a Listbox list to a dynamic range

Thank you again
I came up with something simalar but your code is cleaner ( simpler)

--
Fuzzy logix


"Tom Ogilvy" wrote:

Dim v as Variant
Dim rng as Range
v = Listbox1.List
set rng = range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1)
rng.Value = v
rng.Name = "rng1"

--
Regards,
Tom Ogilvy


"blayne" wrote in message
...
Works Fine
rng1 is a named range & I want to include the new information in the named
range
--
Fuzzy logix


"Tom Ogilvy" wrote:

Dim v as Variant
v = Listbox1.List
range("rng1").Resize(ubound(v,1)-lbound(v,1)+1,1).Value = v

--
Regards,
Tom Ogilvy

"blayne" wrote in message
...
I am looking for some code to write the user selections from a list

box to
a
dynamic worksheet range
something like
range ("rng1")= listbox1.list
and then resize the range dependent on the lengh of the list (list is

1
Column)
--
Fuzzy logix






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
Data Validation List from a Dynamic Named Range on Another Workshe Jeremy Excel Worksheet Functions 5 March 29th 10 09:26 AM
List vs Dynamic Range Name dee Excel Discussion (Misc queries) 2 November 27th 08 06:00 PM
ListBox "dynamic fill range" TK Excel Programming 3 September 10th 04 07:07 AM
Making a Dynamic List in Listbox MikeM[_4_] Excel Programming 2 December 16th 03 04:16 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM


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