#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default list box

I need to fill a range from a two column list box a3:a10 needs to populated
by one of the selection in the two column list. I can get the list box to
work, but have been unavble to link the list box to the cell range.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default list box

I don't believe you can link a single listbox to more than one cell. You
can do this with code

Private Sub Commandbutton1_click()
Dim i as Long, j as Long, sh as Worksheet
j = 2
set sh = worksheets("sheet2")
with userform1.Listbox1
for i = 0 to .Listcount - 1
if .Selected(i) then
j = j + 1
sh.Cells(j,1).Value = .List(i,0)
sh.Cells(j,2).value = .List(i,1)
end if
Next
End with
End Sub

Untested, but this should do what you want

--
Regards,
Tom Ogilvy


"Bryan" wrote in message
...
I need to fill a range from a two column list box a3:a10 needs to

populated
by one of the selection in the two column list. I can get the list box to
work, but have been unavble to link the list box to the cell range.



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
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 2 July 20th 09 11:18 PM
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 1 July 20th 09 08:41 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM


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