diff --git a/README.md b/README.md index ec6a7e4..ed99128 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Finds queried value in a specified column and returns the row number where the q 1. `common.getColumnLetter` **Input**: -1. `String` Search Worksheet Name _(ex. "Sheet 1")_ +1. `Worksheet` Search Worksheet _(ex. ThisWorkbook.Sheets("Sheet 1"))_ 2. `String` Search Term _(ex. "foo")_ 3. `String` Search Column _(ex. "A:A")_ @@ -110,7 +110,7 @@ Finds queried value in a specified row and returns the column number where the q 1. `common.getColumnLetter` **Input**: -1. `String` Search Worksheet Name _(ex. "Sheet 1")_ +1. `Worksheet` Search Worksheet _(ex. ThisWorkbook.Sheets("Sheet 1"))_ 2. `String` Search Term _(ex. "foo")_ 3. `String` Search Row _(ex. "1:1")_ diff --git a/findQueryInColumn.bas b/findQueryInColumn.bas index 5320c51..cb76dea 100644 --- a/findQueryInColumn.bas +++ b/findQueryInColumn.bas @@ -3,15 +3,14 @@ ''''''''''''''''''''''''''''''''''''''''''''''' ' *** Requires Function "getColumnLetter" *** -'recieves input of worksheet (ex. "Sheet 1"), search term (ex. "foo"), and range (ex. "A:A") as string +'receives input of worksheet (ex. ThisWorkbook.Sheets("Sheet 1")), search term (ex. "foo"), and range (ex. "A:A") as string 'outputs row number as integer -Function findQueryInColumn(searchWroksheet As String, searchTerm As Variant, searchColumn As String) As Integer +Function findQueryInColumn(searchWorksheet As Worksheet, searchTerm As Variant, searchColumn As String) As Integer '''method 1 'dimension variables - Dim wb As Workbook: Set wb = ThisWorkbook - Dim ws As Worksheet: Set ws = wb.Sheets(searchWroksheet) + Dim ws As Worksheet: Set ws = searchWorksheet Dim foundRow As Integer 'find the search term within the search range diff --git a/findQueryInRow.bas b/findQueryInRow.bas index ad868fd..3918b38 100644 --- a/findQueryInRow.bas +++ b/findQueryInRow.bas @@ -3,15 +3,14 @@ ''''''''''''''''''''''''''''''''''''''''''''''' ' *** Requires Function "getColumnLetter" *** -'recieves input of worksheet (ex. "Sheet 1"), search term (ex. "foo"), and range (ex. "1:1") as string +'receives input of worksheet (ex. ThisWorkbook.Sheets("Sheet 1")), search term (ex. "foo"), and range (ex. "1:1") as string 'outputs column number as integer -Function findQueryInRow(searchWorksheet As String, searchTerm As Variant, searchRow As String) As Integer +Function findQueryInRow(searchWorksheet As Worksheet, searchTerm As Variant, searchRow As String) As Integer '''method 1 'dimension variables - Dim wb As Workbook: Set wb = ThisWorkbook - Dim ws As Worksheet: Set ws = wb.Sheets(searchWorksheet) + Dim ws As Worksheet: Set ws = searchWorksheet Dim foundCol As Integer 'find the search term within the search range