In Excel VBA you can say:
For c In aRange
doSomethingToC
Next
I’m struggling to do the same in LO Basic.
Pitonyak’s code in OOME
Listing 418. Find cells that are not empty in a range.
Function NonEmptyCellsInRange(oRange, sep$) As String
doesn’t do exactly what I want so am trying to generalize but keep getting errors I don’t understand, so if some can point me in the right direction I’d appreciate it.
I’m trying to find a way to effect every cell in a cellRange in calc and can’t find the proper way to use
getCells or getRangeAddresses.
Given:
StocksOds = ThisComponent
ETFsSheet = StocksOds.CurrentController.ActiveSheet
REM All the following give not found errors:
oAddrs() = oRange.getRangeAddresses() ' Err#423: getRangeAddresses not found
oAddrs() = ETFsSheet.oRange.getRangeAddresses() ' Err#423: oRange not found
oCells() = StocksOds.oRange.getCells() ' Err#423: oRange not found
oCells() = StocksOds.CurrentController.oRange.getCells() ' Err#423: oRange not found
Specifically what is the correct way to call oRange.getRangeAddresses() or oRange.getCells()?
Thanks,
Mike