Hi,
I have written simple code to search data in like parameter (*), but i only getting first single value from Msg Box, If in the sheet there are multiple cells (rowid's) are exists with search value then it needs to be show all values in MsgBox.
Dim Input
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = False
strExcelFile = "C:\Users\0667\Desktop\HCME_Device.xlsx"
objExcel.Workbooks.Open strExcelFile
str = InputBox("Please enter Name")
strValue = "*" & str & "*"
lngRowNum = objExcel.Match(strValue, objExcel.ActiveSheet.Range("C1:C3000"), 0)
If IsNumeric(lngRowNum) Then
val_req = objExcel.ActiveSheet.Range("A"&lngRowNum).value
val_req1 = objExcel.ActiveSheet.Range("E"&lngRowNum).value
val_req2 = objExcel.ActiveSheet.Range("C"&lngRowNum).value
MsgBox "Device ID : " &val_req & vbNewLine & "Device IP : " &val_req1 & vbNewLine & "Device Name :" &val_req2
Else
MsgBox "No match Found"
End If
objExcel.Quit
Set strExcelFile = Nothing
Set objExcel = Nothing
Thanks,
Bookmarks