OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Macro to obtain cell info

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
richhill
OOo Advocate
OOo Advocate


Joined: 16 Jun 2004
Posts: 418
Location: Mesa, AZ

PostPosted: Fri Aug 20, 2004 9:23 am    Post subject: Macro to obtain cell info Reply with quote

I have a macro that grabs control of the mouse and when I click on the spreadsheet - it returns the x,y coords of the mouse.

I'm looking for a hint as to how to determine which cell the mouse is over - in order that I can do some predefined operation (change background color)
Back to top
View user's profile Send private message Visit poster's website
David
Super User
Super User


Joined: 24 Oct 2003
Posts: 5668
Location: Canada

PostPosted: Fri Aug 20, 2004 3:14 pm    Post subject: Re: Macro to obtain cell info Reply with quote

richhill wrote:
I have a macro that grabs control of the mouse and when I click on the spreadsheet - it returns the x,y coords of the mouse.

I'm looking for a hint as to how to determine which cell the mouse is over - in order that I can do some predefined operation (change background color)


I have no idea how you determine your (x,y) coordinates, but don't they tell you precisely that? They may not be in consecutive numerical order, but there should be some definite mathematical relationship. If you move from one cell to another left to right the mouse coordinate will change by some fixed amount for each cell position? When I say I have no idea, I mean that I don't know if the coordinates you determine change by 1 or by 21 by the time you move from one cell to the next. However, the change should be regular.

David.
Back to top
View user's profile Send private message
DannyB
Moderator
Moderator


Joined: 02 Apr 2003
Posts: 3991
Location: Lawrence, Kansas, USA

PostPosted: Sat Aug 21, 2004 7:22 am    Post subject: Re: Macro to obtain cell info Reply with quote

richhill wrote:
I have a macro that grabs control of the mouse and when I click on the spreadsheet - it returns the x,y coords of the mouse.

I'm looking for a hint as to how to determine which cell the mouse is over - in order that I can do some predefined operation (change background color)


From my Calc Examples thread, in this particular message
http://www.oooforum.org/forum/viewtopic.php?p=33524#33524
I wrote....
DannyB wrote:
Here is a routine Henrik wrote to find a cell's position based upon its coordinates.

http://www.oooforum.org/forum/viewtopic.php?p=33486#33486

_________________
Want to make OOo Drawings like the colored flower design to the left?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group