Sub poisk()
S1 = Cells(3, 6)
S2 = Cells(4, 2)
b = Mid(S1, 1, 1)
L1 = Len(S1)
N = 0
L2 = Len(S2)
For i = 1 To L2
a = Mid(S2, i, 1)
If a = b Then
SS = Mid(S2, i, L1)
If SS = S1 Then
N = N + 1
End If
End If
Next i
Cells(3, 10) = N
End Sub
Скачать вложение Excel (XLS)