+ Reply to Thread
Results 1 to 6 of 6

Write a Listbox list to a dynamic range

  1. #1
    blayne
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <blayne@discussions.microsoft.com> wrote in message
    news:3960FA18-6CC7-4083-84DB-A85BF878BAC1@microsoft.com...
    > 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. #3
    blayne
    Guest

    Re: 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" <blayne@discussions.microsoft.com> wrote in message
    > news:3960FA18-6CC7-4083-84DB-A85BF878BAC1@microsoft.com...
    > > 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. #4
    blayne
    Guest

    Re: 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" <blayne@discussions.microsoft.com> wrote in message
    > news:3960FA18-6CC7-4083-84DB-A85BF878BAC1@microsoft.com...
    > > 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. #5
    Tom Ogilvy
    Guest

    Re: 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" <blayne@discussions.microsoft.com> wrote in message
    news:936B8FF8-2A3A-4B33-833D-3255CC4E9745@microsoft.com...
    > 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" <blayne@discussions.microsoft.com> wrote in message
    > > news:3960FA18-6CC7-4083-84DB-A85BF878BAC1@microsoft.com...
    > > > 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. #6
    blayne
    Guest

    Re: 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" <blayne@discussions.microsoft.com> wrote in message
    > news:936B8FF8-2A3A-4B33-833D-3255CC4E9745@microsoft.com...
    > > 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" <blayne@discussions.microsoft.com> wrote in message
    > > > news:3960FA18-6CC7-4083-84DB-A85BF878BAC1@microsoft.com...
    > > > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1