Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default list property of listbox



please see the code below



sub btn_click()
'lis == listbox control in userform
set rng = range("a2:a5")
lis.list=rng.value 'it's ok
set rng = range("a2")
lis.list = rng.value 'it' not ok

'how can i ??
'i don't want to use "additem".



end sub

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default list property of listbox

If rng.Cells.Count 1 Then
lis.List = rng.Value
Else
lis.List = Array(rng.Value)
End If



x taol wrote:

please see the code below

sub btn_click()
'lis == listbox control in userform
set rng = range("a2:a5")
lis.list=rng.value 'it's ok
set rng = range("a2")
lis.list = rng.value 'it' not ok

'how can i ??
'i don't want to use "additem".

end sub

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default list property of listbox


please is it possible making with one syntex without if statement?

for example

lst.List = ~~~~

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default list property of listbox

isn't .list expecting an array?



x taol wrote:

please is it possible making with one syntex without if statement?

for example

lst.List = ~~~~

*** Sent via Developersdex http://www.developersdex.com ***


--

Dave Peterson
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
Runtime Error 380 – Could not set the list property. Invalid property value BernzG[_16_] Excel Programming 2 August 21st 05 10:10 PM
Runtime error 380: Could not set the List property. invalid property value of listbox jasgrand Excel Programming 0 October 6th 04 09:28 PM
ListBox.ColumnHeads Property Kevin Excel Programming 4 July 16th 04 10:55 AM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 AM
Listbox text property not working correctly Shawn[_2_] Excel Programming 2 October 2nd 03 02:35 PM


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