From bcd45e729b549bced94f6c3af3640c3991821b2e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:24:06 +0000 Subject: [PATCH 1/2] Initial plan From 1663fc4ad17bd94834c312da270e48fd623dbd8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 3 Jun 2026 17:26:50 +0000 Subject: [PATCH 2/2] Change searchWorksheet parameter from String to Worksheet type in findQueryInColumn and findQueryInRow --- README.md | 4 ++-- findQueryInColumn.bas | 7 +++---- findQueryInRow.bas | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) 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