以下のマクロを実行すると、「アプリケーション定義またはオブジェクト定義エラー」が発生します。
「DB」シートの各列を解析して、その列を検索したいと思います。
Sub test()
Dim FindString As Range
Dim Rng As Range
Dim i, j As Integer
Dim finalcol As Long
Worksheets("DB").Select
finalcol = Worksheets("DB").Cells(1, Application.Columns.Count).End(x1toleft).column
On Error Resume Next
For i = 1 To finalcol
FindString = Cells(1, i).Value
If Trim(FindString) <> "" Then
With Sheets("DB").Range("A:A")
Set Rng = .Find(What:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End If
Next i
On Error GoTo 0
End Sub