LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Junior Member
 
Posts: 20
Default

I have solved my problem thanks.

If you are interested here is snippet of the code

[code]
.txtFacility.Value = ListBox1.List(r, 8)

Dim var() As String
Dim x As Integer
Dim y As Integer
Dim st As String

st = ListBox1.List(r, 8)

x = InStr(1, st, Chr(13))
'x = InStr(1, st, ",")
var = Split(st, Chr(13))
'var = Split(st, ",")

For x = 0 To UBound(var)
For y = 0 To Me.ListBox2.ListCount - 1
'If Me.ListBox2.ListIndex(y) = var(x) Then
' If InStr(1, UCase(Trim(Me.ListBox2.List(y, 0))), UCase(Trim(var(x))), vbTextCompare) 0 Then
If StrComp(Me.ListBox2.List(y, 0), var(x), vbTextCompare) = 0 Then

'If UCase(Trim(Me.ListBox2.List(y, 0))) = UCase(Trim(var(x))) Then
Debug.Print UCase(Trim(Me.ListBox2.List(y, 0)))
Debug.Print UCase(Trim(var(x)))
Me.ListBox2.Selected(y) = True

Exit For

End If
Next

Next
[code]
 
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
Selected ListBox item to TextBox Honnore Excel Programming 6 April 27th 09 06:57 AM
Adding items from Listbox to empty textbox Corey .... Excel Programming 2 January 30th 09 02:38 AM
remove items from listbox together with add item [email protected] Excel Programming 7 September 23rd 07 01:18 PM
Retaining focus on a textbox / listbox item pair after validation = false. chatterbox Excel Programming 2 April 4th 06 11:42 AM
ListBox Add Item based on criteria James W.[_2_] Excel Programming 1 February 25th 05 08:40 PM


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