Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default ListBox Rowsource Limitation??

I need to fill up a listbox with columns that are not next to each
other on a sheet

I have used main.lstbox.rowsource = "Sheet1!A2:R181"

then I tried

main.lstbox.rowsource = "Sheet1!A2:F181,Sheet1!I2:T181"

At least that one got by the compiler but I do not get the expected
results instead I get a blank list

I tried using a post where you make a union of ranges but that didn't
work out either.

I have a sheets with 200 columns across and depending on what page the
user is looking at I am tried to load up a list box with different
columns. If I could load up a listbox rowsource from columns on
diferent sheets that would just be awesome!

Any help on this one would be very appreciated

Regards,

Dave Baranas
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ListBox Rowsource Limitation??

You can only use the rowsource on a contiguous range.

You will need to add the items using AddItem and then the list or column
commands.

--
Regards,
Tom Ogilvy

Dave Baranas wrote in message
om...
I need to fill up a listbox with columns that are not next to each
other on a sheet

I have used main.lstbox.rowsource = "Sheet1!A2:R181"

then I tried

main.lstbox.rowsource = "Sheet1!A2:F181,Sheet1!I2:T181"

At least that one got by the compiler but I do not get the expected
results instead I get a blank list

I tried using a post where you make a union of ranges but that didn't
work out either.

I have a sheets with 200 columns across and depending on what page the
user is looking at I am tried to load up a list box with different
columns. If I could load up a listbox rowsource from columns on
diferent sheets that would just be awesome!

Any help on this one would be very appreciated

Regards,

Dave Baranas



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default ListBox Rowsource Limitation??

Thanks for your reply Tom. I read through several of your posts on
this subject about trying to get this to work and I tried the 3 ways
below.

It seems like they all want to work and when I step throught the code
they all give me a 'Permission Denied' error when they try to read a
cell of the worksheet.

I put this at the very beginning of the initialize procedure and it
still didn't matter.

I don't have anything protected so I don't understand why this is
happening

I have seen other posts on this but never any clear answer to why. All
I know is that this stuff needs to be done in the initialization of
the form and when I make it the first thing the program is going to do
and this happens, I am starting to believe I am on a never ending
journey just to fill up a listbox.

Any help you can give will be very much appreciated,

Regards,

Dave Baranas
----------------------------------------

' With Mn.LstWlInd
' .ColumnCount = 16
' .Top = 0
' .Height = 309
' .ColumnWidths =
"35,35,70,45,45,40,60,60,45,55,55,55,55,55,55, 55"
' .List = Union(Range("Wdata!A2:F181"),
Range("Wdata!I2:P181")).Value
' End With


' For Each Cell In worksheets("Wdata").Range("A2:F181")
' Mn.LstWlInd.AddItem Cell.Value
' Next Cell



'IVal = -1
' With Mn.LstWlInd
' .ColumnCount = 16
' .Top = 0
' .Height = 309
' .ColumnWidths =
"35,35,70,45,45,40,60,60,45,55,55,55,55,55,55, 55"
' For Each Cell In worksheets("Wdata").Range("A2:F181,I2:P181")
' IVal = IVal + 1
' .AddItem Cell.Value
' For JVal = 1 To 5
' .List(IVal, JVal) = Cell.Offset(0, JVal).Value
' Next
' Next
' End With








----------------------------------------
"Tom Ogilvy" wrote in message ...
You can only use the rowsource on a contiguous range.

You will need to add the items using AddItem and then the list or column
commands.

--
Regards,
Tom Ogilvy

Dave Baranas wrote in message
om...
I need to fill up a listbox with columns that are not next to each
other on a sheet

I have used main.lstbox.rowsource = "Sheet1!A2:R181"

then I tried

main.lstbox.rowsource = "Sheet1!A2:F181,Sheet1!I2:T181"

At least that one got by the compiler but I do not get the expected
results instead I get a blank list

I tried using a post where you make a union of ranges but that didn't
work out either.

I have a sheets with 200 columns across and depending on what page the
user is looking at I am tried to load up a list box with different
columns. If I could load up a listbox rowsource from columns on
diferent sheets that would just be awesome!

Any help on this one would be very appreciated

Regards,

Dave Baranas

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
RowSource for Sheet ComboBox Minitman Excel Worksheet Functions 3 March 24th 08 09:43 PM
Listbox rowsource on Userform Wendy Excel Discussion (Misc queries) 6 February 28th 08 05:46 PM
???Help??? Userform.Listbox.rowsource = ??? Steve Sparti Excel Discussion (Misc queries) 0 March 1st 06 09:44 PM
Is refreshing listbox rowsource in listbox click event possible? Jeremy Gollehon[_2_] Excel Programming 4 September 25th 03 06:45 PM
listbox rowsource Christy[_2_] Excel Programming 4 September 20th 03 11:44 PM


All times are GMT +1. The time now is 08:32 AM.

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"