I think I am making progress, and thank you for the great search box! The 'Dim LSearchRow' and Dim LCoptToRow' rows I have changed from the 'As Integer' to 'As String' (my own guess, and I haven't been able to test it yet.
My real question is in lines (14) and (15); the code that I copied from the web has me searching for a set variable. How do I get the program to search for my 'String'?
[code]
(1) Sub box1()
(2) On Error GoTo Err_Execute
(3) Sub findString()
(4) Dim sFind As String
(5) sFind = Application.InputBox("Enter the search string", "Search...")
(6) If sFind > "" Then
(7) Dim LSearchRow As String
(8) Dim LCopyToRow As String
(9) 'Start search in row 2
(10) LSearchRow = 2
(11) 'Start copying data to row 2 in Sheet2 (row counter variable)
(12) LCopyToRow = 2
(13) While Len(Range("A" & CStr(LSearchRow)).Value) > 0
(14) 'If value in column B = "CAT", copy entire row to Sheet2
(15) If Range("B" & CStr(LSearchRow)).Value = "CAT" Then
(16) 'Select row in Sheet1 to copy
(17) Rows(CStr(LSearchRow) & ":" & CStr(LSearchRow)).Select
(18) Selection.Copy[code]
Yours Sincerely,
Bill Rudd
Bookmarks