1

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?

Tobi S
  • 145
  • 8

1 Answers1

2

Use subStrRan = subStrRan & Cell.CellAddress.Row.

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

Vincent
  • 417
  • 3
  • 12
  • Alright thanks it is helpful also in my Libre Office. I already know about the vba compatibility, but wasn't quite sure. Should I close the question? – Tobi S Jun 08 '21 at 09:40