Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Userform list for more than one column of data

I am using code that lets me use the first column of data to the right of a
partID.
I need the TWO columns to the right. Afraid I am new to the list, count
function in the userform. Here is what I have:

For Each cPart In ws.Range("PartIDList")
With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart


Then it writes to another page with this:
..Cells(lRow, 4).Value = Me.cboPart.Value
..Cells(lRow, 5).Value = Me.cboPart.List(lPart, 1)

I need the next column, 6, to have the next column of data for the same
part.value and part.list.

I tried:
Cells(lRow, 6).Value = Me.cboPart.List(lPart, 2), but that did not work.

Thanks for any help!!

David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Userform list for more than one column of data

How about just keep adding those values:

With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
.List(.ListCount - 1, 2) = cPart.Offset(0, 2).Value
.List(.ListCount - 1, 3) = cPart.Offset(0, 3).Value
'etc
End With

then

..Cells(lRow, 4).Value = Me.cboPart.Value
..Cells(lRow, 5).Value = Me.cboPart.List(lPart, 1)
..Cells(lRow, 6).Value = Me.cboPart.List(lPart, 2)
..Cells(lRow, 7).Value = Me.cboPart.List(lPart, 3)
'etc

You can use the .columncount to specify the number of columns you want and
..columnwidths to hide the ones you don't want to see.


David wrote:

I am using code that lets me use the first column of data to the right of a
partID.
I need the TWO columns to the right. Afraid I am new to the list, count
function in the userform. Here is what I have:

For Each cPart In ws.Range("PartIDList")
With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart

Then it writes to another page with this:
.Cells(lRow, 4).Value = Me.cboPart.Value
.Cells(lRow, 5).Value = Me.cboPart.List(lPart, 1)

I need the next column, 6, to have the next column of data for the same
part.value and part.list.

I tried:
Cells(lRow, 6).Value = Me.cboPart.List(lPart, 2), but that did not work.

Thanks for any help!!

David


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Userform list for more than one column of data

Thanks a bunch...I see where I went wrong. Many thanks again!

David

"Dave Peterson" wrote:

How about just keep adding those values:

With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
.List(.ListCount - 1, 2) = cPart.Offset(0, 2).Value
.List(.ListCount - 1, 3) = cPart.Offset(0, 3).Value
'etc
End With

then

..Cells(lRow, 4).Value = Me.cboPart.Value
..Cells(lRow, 5).Value = Me.cboPart.List(lPart, 1)
..Cells(lRow, 6).Value = Me.cboPart.List(lPart, 2)
..Cells(lRow, 7).Value = Me.cboPart.List(lPart, 3)
'etc

You can use the .columncount to specify the number of columns you want and
..columnwidths to hide the ones you don't want to see.


David wrote:

I am using code that lets me use the first column of data to the right of a
partID.
I need the TWO columns to the right. Afraid I am new to the list, count
function in the userform. Here is what I have:

For Each cPart In ws.Range("PartIDList")
With Me.cboPart
.AddItem cPart.Value
.List(.ListCount - 1, 1) = cPart.Offset(0, 1).Value
End With
Next cPart

Then it writes to another page with this:
.Cells(lRow, 4).Value = Me.cboPart.Value
.Cells(lRow, 5).Value = Me.cboPart.List(lPart, 1)

I need the next column, 6, to have the next column of data for the same
part.value and part.list.

I tried:
Cells(lRow, 6).Value = Me.cboPart.List(lPart, 2), but that did not work.

Thanks for any help!!

David


--

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
building list from a column of data driller Excel Worksheet Functions 3 May 30th 07 02:51 PM
Userform to enter values and shown in same userform in list helmekki[_104_] Excel Programming 0 November 19th 05 03:23 PM
Capture and list data from a column or row Jeff Excel Worksheet Functions 2 October 17th 05 07:44 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Pass Data from List Boxes in Userform ExcelMonkey[_190_] Excel Programming 1 February 19th 05 10:45 PM


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