This code was working file, I moved a search box from one worksheet to another and now when I hit the search button it brings up the opportunity to save the file. If I hit cancel it completes the code and does the right thing. The code in bold is what was changed. Any ideas are appreciated.
Rich (BB code):
Sub finddata()
Dim ApplicationNumber As String
Dim finalrow As Integer
Dim i As Integer
Dim LastRow As Long
Sheets("SearchMasterTable").Range("A6:CR506").ClearContents
ApplicationNumber = Sheets("Master Table").Range("G2").Value
finalrow = Sheets("Master Table").Range("A10000").End(xlUp).Row
Application.ScreenUpdating = False
LastRow = Sheets("Master Table").Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
Sheets("Master Table").Range("B8:B" & LastRow).AutoFilter Field:=1, Criteria1:=ApplicationNumber
On Error Resume Next
Sheets("Master Table").Range("B9:B" & LastRow).SpecialCells(xlCellTypeVisible).EntireRow.Copy Sheets("SearchMasterTable").Cells(Sheets("SearchMasterTable").Rows.Count, "A").End(xlUp).Offset(1, 0)
On Error GoTo 0
If Sheets("Master Table").AutoFilterMode = True Then Sheets("Master Table").AutoFilterMode = False
Application.ScreenUpdating = True
End Sub