jump to a specified cell in a BASIC macro? [closed]

asked 2014-06-13 02:55:47 +0100

madboat gravatar image

updated 2015-09-04 21:18:39 +0100

Alex Kemp gravatar image

all in the title. I want to move the viewer such that I am looking at a particular cell which I want the user to change. I am not seeing any way to do this in a BASIC macro, and the documentation is too fragmented to be much help. Here's the context

'look for duplicate entries     
for ii = dataStart + 1 to dataEnd step 1
    calcS2 = calcS1
    calcS1 = thisComponent.Sheets(0).getCellByPosition(0, ii)    & thisComponent.Sheets(0).getCellByPosition(1, ii)
    if calcS2 = calcS1 then
        msgBox("ERROR: Duplicate entries on line " & ii)
                    viewTheFollowingSheetColumnRow(0, 0, ii)
    else
    end if
next ii

And while I'm here, these are the resources I've found for BASIC, which are wanting. If anyone has a LibreOffice BASIC bible, I'd be much obliged.

https://wiki.openoffice.org/wiki/Docu...

http://docs.libreoffice.org/sc/html/i...

ps. Libre office 3.5.7.2, on Ubuntu 12.04 LTS

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2016-02-25 10:01:54.312297

Comments

I do not really understand the "context". How should the SUB be triggered to run? If I want an alert concerning duplicates (in $A$2:$A$21, e.g.) I use a helper column containing a formula (here given for cell B5) like =IF(COUNTIF($A$2:$A5;$A5)>1;"Duplicate entry! Regard row "&TEXT(MATCH($A5;$A$2:$A5;0)+ROW($A$2:$A$21)-1;"0");"")

This is if the alert shall appear for every cell in the range (Fill it in!) - without filtering.

Lupp gravatar imageLupp ( 2014-06-13 12:47:34 +0100 )edit

I was just going to trigger it with a toolbar button. Something like this ought to be running periodically... but I don't want to press my luck trying to implement something like that.

As far as a helper columm, I suppose I can implement something like that... I'm dealing with a spreadsheet that is thousands of entries long, though; jumping to problem entries would be a useful feature (otherwise I have to scroll through thousands of rows by hand, looking for errors when I merge new data in).

madboat gravatar imagemadboat ( 2014-06-13 21:40:42 +0100 )edit