我一直在下面的查找功能中获得Type Mismatch 13。 " WBS"早先作为工作表,bacol,pccol调整为整数。我"定义" BASearch,srchstring,但我得到错误,我不知道为什么。
Public Sub FindBusinessArea()
Dim BASearch As Range
Set BASearch = WBS.Range(Cells(4, 11).Address, Cells(6, 29).Address)
Dim srchstring As String
Dim Rng As Range
srchstring = "BA"
With BASearch
Set Rng = .Find(What:=srchstring, After:=ActiveCell, LookIn:=xlLabels, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)
If Not Rng Is Nothing Then
bacol = Rng.Column
pccol = bacol + 1
End If
End With
WBSFindCopyCompare
End Sub