How to pick up the strings by picking up the line and changing the column

Asked

Viewed 53 times

0

   Set rgFound = Range("B1:B1000").Find(Sheets("FormAluguer").Range("E10"))
If rgFound Is Nothing Then
    resposta = MsgBox("Não encontrado.", vbYesNo + vbExclamation, "stock incorrecto")
Else
Dim mrange As String
Dim linha As Integer


mrange = rgFound.Address(RowAbsolute:=False, ColumnAbsolute:=False, External:=False)
 resposta = MsgBox("Foi encontrado em :" + rgFound.Row, vbYesNo + vbExclamation, "stock incorrecto")

End If

mrange returns $B7 and I wanted to take this amount and retain the number of row in this case 7 to then do accounts in column Row 7 do accounts

tried rgFound.Address(). Row but does not work

1 answer

0


The problem was in the concatenate operator

answer = Msgbox("Was found in :" + rgFound.Row, vbYesNo + vbExclamation, "incorrect stock")

it must be so:

answer = Msgbox("Was found in :" & rgFound.Row, vbYesNo + vbExclamation, "incorrect stock")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.