I would like your help with something I got stuck.
Basically I want to do a variable iRow, by finding a cell with the value OBRC, the cell that has this value is retrieved by the command find, then I got the value from the row and treat it as a string manipulating the string to get only the row number as exit, till this part was not a big deal. But when I need to use this string variable CellString as part of the range value it doesn't work.
I need this to make my script work, as I need this value to write the information on the spreadsheet, so I would like to know how can I solve it? I was thinking to convert this string as double but I don't know how to do it.
Here is my code:
Function FindCell()
Dim CellLocation As Range
Dim CellString As String
Set CellLocation = Sheets("Sheet1").Range("A1048576").Find("OBRC") ' retrieves the value OBRC + the row.
CellString = Right(CellLocation.Text, 0) ' Manipulate the entire value OBEC + Row and retrieves only the row.
With ThisWorkbook.Sheets("Sheet1")
.Range("A" & CellString).Value = "Teste" 'it concatenate the Column + the row, it should be working but is not
End With
End Function
Fell free to give me any advice.
CellString = Right(CellLocation.Text, 0)does not return the row of the found cell, but will return and empty string.Right(CellLocation.Text, 0)Set CellLocation = Sheets("Sheet1").Range("A1048576").Find("OBRC")is only looking in one cellA1048576. If that is the cell you want then you can skip the whole thing and just do.Range(A1048576).Value = "Teste"but something tell me you are loooking for it inSheets("Sheet1").Range("A:A").Find("OBRC")