Difference between revisions of "GetFirstInstanceInExcel"
From scripting
(Created page with " Function GetFirstInstanceInExcel(InputVal As String, ColumnNo As Integer, EndRow As Integer) As Integer Dim LCounter As Integer LCounter = 2 While LCounter <= EndRow...") |
(No difference)
|
Latest revision as of 05:56, 22 April 2017
Function GetFirstInstanceInExcel(InputVal As String, ColumnNo As Integer, EndRow As Integer) As Integer Dim LCounter As Integer LCounter = 2 While LCounter <= EndRow CurCellStr = CStr(CurCells(LCounter, ColumnNo).Value) If CurCellStr = InputVal Then GetFirstInstanceInExcel = LCounter Exit Function End If LCounter = LCounter + 1 Wend GetFirstInstanceInExcel = -1 End Function