Welcome to NeoOffice developer notes and announcements
NeoOffice
Developer notes and announcements
 
 

This website is an archive and is no longer active
NeoOffice announcements have moved to the NeoOffice News website


Support
· Forums
· NeoOffice Support
· NeoWiki


Announcements
· Twitter @NeoOffice


Downloads
· Download NeoOffice


  
NeoOffice :: View topic - Calc Makro Programming - How to compare cell values
Calc Makro Programming - How to compare cell values
 
   NeoOffice Forum Index -> NeoOffice Releases
View previous topic :: View next topic  
Author Message
Grabowski
Blue Pill


Joined: Oct 01, 2006
Posts: 2

PostPosted: Sat Nov 25, 2006 1:03 pm    Post subject: Calc Makro Programming - How to compare cell values

I'm trying to write a vocabular training tool with NeoOffice Calc. And there I want to use a makro to compare the content of two cells and depending on the result I want to set the color of the cell.

My very simple problem is now: How can I compare two cells using a makro?
The following program code doesn't work:
If B1 = B2 Then ...
or
If B1.Value = B2.Value Then ...
or
If Range(B1).Value = Range(B2).Value Then...
or ...

I don't know how to read the value of a cell. Unfortunately "Help" didn't help me.
Back to top
Samwise
Captain Naiobi


Joined: Apr 25, 2006
Posts: 2315
Location: Montpellier, France

PostPosted: Sat Nov 25, 2006 1:20 pm    Post subject:

Unfortunately, there are few people here with in-depth knowledge of StarBasic and OpenOffice.org macros. You should get better answers there :

http://www.oooforum.org/
Back to top
Grabowski
Blue Pill


Joined: Oct 01, 2006
Posts: 2

PostPosted: Sat Nov 25, 2006 1:58 pm    Post subject:

Thank you for your hint.
I didn't know that reading the value of a cell is a job for experts.
But fortunately I'm one of those experts now
Smile
Back to top
Samwise
Captain Naiobi


Joined: Apr 25, 2006
Posts: 2315
Location: Montpellier, France

PostPosted: Sat Nov 25, 2006 2:32 pm    Post subject:

Yeah, well Smile

It probably isn't such a big deal, but you have to learn the syntax somewhere, and if you don't know, it can take a long time to figure out; it's much easier to ask people who already know ...
Back to top
jgd
Agent Smith


Joined: Feb 27, 2005
Posts: 1531
Location: France

PostPosted: Sun Nov 26, 2006 2:35 am    Post subject:

Grabowski

You may check Andrew Pitonyak's document, which you can download here :

http://www.pitonyak.org/oo.php

Click PDF English Macro Document (Updated November 9, 2006)

It contains a chapter about Calc macros which can help you.

Jacqueline
Back to top
Jim
Councilperson


Joined: Jun 21, 2003
Posts: 173
Location: Selmer, Tennessee

PostPosted: Sun Nov 26, 2006 11:16 am    Post subject:

Unless you want to do something other than change the cell's background color, then just use Format->Conditional formatting...

Let's say, for example, you want to indicate wrong answers by changing the cell background to red. Define a cell style with that background color, and name it "wrong answer". Then, click in the answer cell to select it, and choose Format->Conditional formatting... Set your parameters, choose the "wrong answer" style, and you're done. No macro needed.

_________________
Jim Plante
MacOS X 10.6.34, MacBook 2GHz C2Duo, 2gb, Neo 3.1.1 p 1
Back to top
Display posts from previous:   
   NeoOffice Forum Index -> NeoOffice Releases All times are GMT - 7 Hours
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest © Planamesa Inc.
NeoOffice is a registered trademark of Planamesa Inc. and may not be used without permission.
PHP-Nuke Copyright © 2005 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.