Code: Select all
sub testing
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oSelectedCells = ThisComponent.CurrentSelection
oActiveCell = oSelectedCells.CellAddress
nRow = oActiveCell.Row
Do Until nRow > 500
redim preserve step1(1) as new com.sun.star.beans.PropertyValue
step1(0).Name = "By"
step1(0).Value = 1
step1(1).Name = "Sel"
step1(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoDownToEndOfData", "", 0, step1())
MsgBox "Next Item Found --- " & nRow
Loop
dim steplast(0) as new com.sun.star.beans.PropertyValue
steplast(0).Name = "ToPoint"
steplast(0).Value = "$C$1"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, steplast())
MsgBox "steplast --- " & nRow
end sub
Can the Active Cell be changed within the loop so the value of nRow actually changes and the condition can be met?
TIA
T. R. Valentine