Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default How to add itemfrom a worksheet to a Listbox

I have a form with a 2 column listbox, and a worksheet with a two column
list. I want to add items from the worksheet list to the listbox based on
specific conditions. For example:

For Each c5 In dbeWS.Range("B2:B" & rngSAPlines).Cells
If c5.Value = ufrmsiteInfo.cmbSiteID.Text And c5.Offset(0,1).Value
ufrmsiteInfo.txtbox3.Text And c5.Offset(0, 4).Value = False Then
ufrmsiteInfo.ListBox4.AddItem "worksheet row here"
End If
Next c5
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default How to add itemfrom a worksheet to a Listbox

I'm not sure what your question is. Is it that you want to know how to get
the "worksheet row here"? If so, try using c5.Row in place of your quote.

--
Rick (MVP - Excel)


"Ayo" wrote in message
...
I have a form with a 2 column listbox, and a worksheet with a two column
list. I want to add items from the worksheet list to the listbox based on
specific conditions. For example:

For Each c5 In dbeWS.Range("B2:B" & rngSAPlines).Cells
If c5.Value = ufrmsiteInfo.cmbSiteID.Text And c5.Offset(0,1).Value
ufrmsiteInfo.txtbox3.Text And c5.Offset(0, 4).Value = False
Then
ufrmsiteInfo.ListBox4.AddItem "worksheet row here"
End If
Next c5


  #3   Report Post  
Posted to microsoft.public.excel.programming
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default How to add itemfrom a worksheet to a Listbox

Not the whole row just the two cells next to each other. I have a 2 column
table in the worksheet i.e., Range("B2:C391") so,
ufrmsiteInfo.ListBox4.AddItem "worksheet row here"

worksheet row here could be B3 and C3


"Rick Rothstein" wrote:

I'm not sure what your question is. Is it that you want to know how to get
the "worksheet row here"? If so, try using c5.Row in place of your quote.

--
Rick (MVP - Excel)


"Ayo" wrote in message
...
I have a form with a 2 column listbox, and a worksheet with a two column
list. I want to add items from the worksheet list to the listbox based on
specific conditions. For example:

For Each c5 In dbeWS.Range("B2:B" & rngSAPlines).Cells
If c5.Value = ufrmsiteInfo.cmbSiteID.Text And c5.Offset(0,1).Value
ufrmsiteInfo.txtbox3.Text And c5.Offset(0, 4).Value = False
Then
ufrmsiteInfo.ListBox4.AddItem "worksheet row here"
End If
Next c5



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
Worksheet and Listbox Steven Excel Programming 2 November 29th 06 02:16 AM
Not allow duplicates from listbox to Worksheet Casey[_96_] Excel Programming 1 June 1st 06 03:50 PM
Help! Activate worksheet from a listbox Bob Phillips Excel Worksheet Functions 0 May 18th 05 09:09 AM
Using a VBA listbox to populate a worksheet Paulc Excel Programming 1 January 28th 05 01:29 PM
listbox.value not equal to listbox.list(listbox.listindex,0) ARB Excel Programming 0 October 22nd 03 12:46 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"