Tobi S
Tobi S

Reputation: 161

Libreoffice How to convert Cell.CellAddress.Row (is a number already) to an interger?

I would like to create a String for a CellRange and for that I have a RowNumber, but struggle to append it to a String
The 1st two lines of code are only for clarification, that you know which datatype Cell has

CellRange = sheetb.getCellByPosition(nColumn, i)  
Cell = CellRange.findFirst(Descript)




Dim subStrRan As string
subStrRan = "B1:B"
subStrRan = subStrRan + Cell.CellAddress.Row
print subStrRan  

When I run it, it tells me that the two datatypes of my concatenation (line 5) are incompatible - is there a way to cast it to the right datatype?

Upvotes: 1

Views: 307

Answers (1)

Vincent
Vincent

Reputation: 508

Use subStrRan = subStrRan & Cell.CellAddress.Row.

+ operator should not be used for concatenation. See this post for details.

Upvotes: 2

Related Questions