
Descrição do Problema:Encontre um instr (que é um número) e verifique se o valor do instr contém algum caractere na frente dele ou não (por exemplo, 123, x123). Se instr ou instr com caractere corresponder ao valor da planilha 2, então caixa de mensagem sim.
Problema:Posso encontrar o instr, mas não consigo verificar se o instr contém algum caractere na frente dele ou não. Como faço para verificar se está com a função left(chr) ou algo assim. Aqui está o meu código, mas tudo o que ele faz é apenas encontrar o instr e não o chr com o instr.
Sub tym()
Dim ws1 As Worksheet, wb As Workbook, ws2 As Worksheet
Dim b, c As Range, rngNums As Range, rngText As Range
Dim dNums, dText, rN As Long, rT As Long, t, m
Set wb = ActiveWorkbook
Set ws1 = wb.Worksheets("Sheet1")
Set ws2 = wb.Worksheets("Sheet2")
Set c = wb.Worksheets("Sheet3").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
Set rngNums = ws1.Range(ws1.Range("A1"), ws1.Cells(Rows.Count, 1).End(xlUp))
dNums = rngNums.Value
Set rngText = ws2.Range(ws2.Range("A1"), ws2.Cells(Rows.Count, 1).End(xlUp))
dText = rngText.Value
For rN = 1 To UBound(dNums, 1)
b = "-" & dNums(rN, 1) & "-" (right here im defining to find instr but how do i add a function to find char front of instr)
For rT = 1 To UBound(dText, 1)
If InStr(1, dText(rT, 1), b) > 0 Then
MsgBox "yes"
End If
Next rT
Next rN
End Sub