Ask Your Question

What's themacro equivalent to Row(Name)?

asked 2017-01-19 19:37:05 +0200

I am writing a macro to fill several cells using a loop and Sheet.GetCellByPosition(). Rather than have the first cell position hard-coded, I wish to be able to reference the row and column numbers for a cell with a defined name. Something like Row_1 = ROW(Dir_12) and Col_1 = COLUMN(Dir_12) where Dir_12 is the name of a cell $E$4. However, I can't find the macro equivalent of these functions. There must be one, but I can't find it. Thanks for your help...

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2017-01-19 20:42:40 +0200

    oAddr = Sheet.getCellRangeByName("Dir_12").getCellAddress()
    Cell = Sheet.GetCellByPosition( oAddr.Column,oAddr.Row)   ' Wind Direction
    Cell.String = CHR$(85)
edit flag offensive delete link more

answered 2017-01-19 21:23:54 +0200

karolus gravatar image


cell = thisComponent.NamedRanges.getByName("Dir_12").ReferredCells
cell.String = "U"

why the hell did you use chr() for printable chars inside ASCII-range?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2017-01-19 19:37:05 +0200

Seen: 25 times

Last updated: Jan 19 '17