Googling...
I need to use the function in object to find MyVar in column 3 of listview1 and return boolean value..
How to?
Tks.
Set ITM = Listview1.FindItem(
-
- Administrator
- Posts: 78483
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Set ITM = Listview1.FindItem(
Should the text in the column be equal to MyVar, or should it contain MyVar (with possibly other text)?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: Set ITM = Listview1.FindItem(
... i need to find only in column 3 if it contain a MyVar value in any row of columnHansV wrote:Should the text in the column be equal to MyVar, or should it contain MyVar (with possibly other text)?
-
- Administrator
- Posts: 78483
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Set ITM = Listview1.FindItem(
The following will tell you if MyVar is found in any subitem:
Code: Select all
Dim MyVar As String
Dim IsFound As Boolean
MyVar = "..."
IsFound = Not (Me.ListView1.FindItem(MyVar, lvwSubItem, , False) Is Nothing)
MsgBox IsFound
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78483
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Set ITM = Listview1.FindItem(
And this will tell you if MyVar is found in the 3rd column:
Code: Select all
Dim MyVar As String
Dim IsFound As Boolean
Dim itm As ListItem
MyVar = "..."
Set itm = Me.ListView1.FindItem(MyVar, lvwSubItem, , False)
If Not itm Is Nothing Then
IsFound = itm.ListSubItems(2).Text = MyVar
End If
MsgBox IsFound
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4355
- Joined: 26 Apr 2010, 17:36
Re: Set ITM = Listview1.FindItem(
GREAT!.HansV wrote:And this will tell you if MyVar is found in the 3rd column:
Code: Select all
Dim MyVar As String Dim IsFound As Boolean Dim itm As ListItem MyVar = "..." Set itm = Me.ListView1.FindItem(MyVar, lvwSubItem, , False) If Not itm Is Nothing Then IsFound = itm.ListSubItems(2).Text = MyVar End If MsgBox IsFound
TKS