My script reads out 3 lines (introw 1, 2 and 3). But it only shows the intRow line 2, how can I make the inputbox look for the line in Excel and show it in the message box? Help would be appreciated!
' Read an Excel Spreadsheet
sFNInput="C:\Models.csv"
' User enters value
sInp=Inputbox("Enter Identity text")
If sInp = "" Then WScript.Quit
On Error Resume Next
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open_(sFNInput)
Do Until objExcel.Cells(intRow,1).Value = ""
sID=objExcel.Cells(intRow, 1).Value
sType=objExcel.Cells(intRow, 2).Value
sColor=objExcel.Cells(intRow, 3).Value
Introw = 2
' If user entered value matches (row 2 matches value before comma in row 1)
sResult = InStr(1,sID,sInp,1)
If sResult <> 0 Then
'return row 3
sResult=sGroup
' entered value goes in Field 1 of my application
Field1=sInp
' return value goes in Field2 of my application
Field2= sResult
end if
intRow = Introw + 1
msgbox "productRange: " & sID & " type: " & sType & " colorcode: " & sColor
Loop
objExcel.Quit
' Read an Excel Spreadsheet
sFNInput="C:\Models.csv"
' User enters value
sInp=Inputbox("Enter Identity text")
If sInp = "" Then WScript.Quit
On Error Resume Next
Const ForAppending = 8
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open_(sFNInput)
Do Until objExcel.Cells(intRow,1).Value = ""
sID=objExcel.Cells(intRow, 1).Value
sType=objExcel.Cells(intRow, 2).Value
sColor=objExcel.Cells(intRow, 3).Value
Introw = 2
' If user entered value matches (row 2 matches value before comma in row 1)
sResult = InStr(1,sID,sInp,1)
If sResult <> 0 Then
'return row 3
sResult=sGroup
' entered value goes in Field 1 of my application
Field1=sInp
' return value goes in Field2 of my application
Field2= sResult
end if
intRow = Introw + 1
msgbox "productRange: " & sID & " type: " & sType & " colorcode: " & sColor
Loop
objExcel.Quit