Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with setting values in a listbox


Hi,
I'm two listboxes each one has 2 columns and i hv written code that
transfers values from one listbox to another. however, i can't get to
set the value of a single listitem. the only option it allows me is to
use a 2-d array and set it to the list property.
as i saw in help a statement like
listbox1.list(0,0) = "somevalue"
should be possible, even if i try the above statement it gives me an
error in exactly that statement:
run time error 381: could not get the list property. Invalid
property array index.

a listbox index starts with zero, so it shouldn't be a problem, so i
don't understand where am i wrong or is this a bug with the product.
I'm using excel 2000 and VBA version is 6.3

I would appreciate any help.
Thanks in advance.


--
kankal
------------------------------------------------------------------------
kankal's Profile: http://www.excelforum.com/member.php...o&userid=16870
View this thread: http://www.excelforum.com/showthread...hreadid=320526

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Problems with setting values in a listbox

This worked for me

Me.ListBox1.List(1) = "Lynne"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"kankal" wrote in message
...

Hi,
I'm two listboxes each one has 2 columns and i hv written code that
transfers values from one listbox to another. however, i can't get to
set the value of a single listitem. the only option it allows me is to
use a 2-d array and set it to the list property.
as i saw in help a statement like
listbox1.list(0,0) = "somevalue"
should be possible, even if i try the above statement it gives me an
error in exactly that statement:
run time error 381: could not get the list property. Invalid
property array index.

a listbox index starts with zero, so it shouldn't be a problem, so i
don't understand where am i wrong or is this a bug with the product.
I'm using excel 2000 and VBA version is 6.3

I would appreciate any help.
Thanks in advance.


--
kankal
------------------------------------------------------------------------
kankal's Profile:

http://www.excelforum.com/member.php...o&userid=16870
View this thread: http://www.excelforum.com/showthread...hreadid=320526



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
error 13 when setting worksheet listbox Amedee Van Gasse Excel Discussion (Misc queries) 1 September 24th 08 02:06 PM
Setting Listbox Size VBA Sandy Excel Worksheet Functions 1 April 27th 07 05:48 PM
Setting and filter Listbox data Gizmo63 Excel Discussion (Misc queries) 1 February 5th 07 04:03 PM
problems resetting backcolor in listbox Kelley[_3_] Excel Programming 0 November 1st 04 10:23 PM
Sorting ListBox results or transposing ListBox values to other cells for sorting Rob[_8_] Excel Programming 1 July 9th 03 04:35 AM


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