Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Display multicolumn box

I have one number in cell a5. In cells A10:A250 i have the product
numbers.
I want to find in area A10:a250 all samme numbers as in cell a5 and
display
rows in multicolumn box(usreform) where these numbers are.

if it is possible I want to display only results from column a,c and f.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display multicolumn box

Dim cell as Range
with userform1
.listbox1.Rowsource = ""
.listbox1.ColumnCount = 3
.listbox1.clear
End With
set sh = Worksheets("Sheet1")
for each cell in sh.Range("A10:A250")
if cell.value = sh.Range("A5").Value then
with userform1
.listbox1.additem cell.Value
.listbox1.list(.listbox1.listcount,1) = cell.offset(0,2).Value
.listbox1.list(.listbox1.listcount,2) = cell.offset(0,5).Value
End with
end if
Next

--
Regards,
Tom Ogilvy

"Alen32" wrote in message
lkaboutsoftware.com...
I have one number in cell a5. In cells A10:A250 i have the product
numbers.
I want to find in area A10:a250 all samme numbers as in cell a5 and
display
rows in multicolumn box(usreform) where these numbers are.

if it is possible I want to display only results from column a,c and f.





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Display multicolumn box

where and How to insert this code?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Display multicolumn box

Do I need make userform with listboxes?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display multicolumn box

Well, you said:
I want to find in area A10:a250 all samme numbers as in cell a5 and
display rows in multicolumn box(usreform)


so yes, you would need to create a userform and put a listbox on it if that
is what you want. You could put appropriate code in the userform initialize
event, the activate event or tie it to a button depending on what you want
your functionality to be.

--
Regards,
Tom Ogilvy

"Alen32" wrote in message
lkaboutsoftware.com...
Do I need make userform with listboxes?





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Display multicolumn box

also, I had some bad code in my original. I neglected to account for the
fact that the row references in list are zero based, so

.listbox1.additem cell.Value
.listbox1.list(.listbox1.listcount,1) = cell.offset(0,2).Value
.listbox1.list(.listbox1.listcount,2) = cell.offset(0,5).Value


should be

.listbox1.additem cell.Value
.listbox1.list(.listbox1.listcount-1,1) = cell.offset(0,2).Value
.listbox1.list(.listbox1.listcount-1,2) = cell.offset(0,5).Value

I did account for the zero base for columns.

Also, you posted this question earlier. Dick Kusleika responsed to that
with a slighty different approach (using FIND) and wrote it as a userform
initialize event. so that may be easier for you to implement.

--
Regards,
Tom Ogilvy


"Alen32" wrote in message
lkaboutsoftware.com...
Do I need make userform with listboxes?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Display multicolumn box

Thanks Tom

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
display multicolumn box Alen32 Excel Programming 1 March 12th 05 05:00 PM
multicolumn listbox move or value set Andrew Smith Excel Programming 3 August 25th 04 05:18 AM
Reordering with Multicolumn Listbox asmenut Excel Programming 2 August 17th 04 01:53 PM
Multicolumn Combo Box PokerDude Excel Programming 2 January 29th 04 04:02 PM
multicolumn Listbox and textalignment John Holland Excel Programming 3 September 11th 03 01:45 AM


All times are GMT +1. The time now is 08:55 PM.

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"