[Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register]

Author Message
richhill

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

 Posted: Fri Aug 20, 2004 9:23 am    Post subject: Macro to obtain cell info 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)
David
Super User

Joined: 24 Oct 2003
Posts: 5668

Posted: Fri Aug 20, 2004 3:14 pm    Post subject: Re: Macro to obtain cell info

 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.
DannyB
Moderator

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

Posted: Sat Aug 21, 2004 7:22 am    Post subject: Re: Macro to obtain cell info

 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
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT - 8 Hours Page 1 of 1

 Jump to: Select a forum OpenOffice.org Forums----------------Setup and TroubleshootingOpenOffice.org WriterOpenOffice.org CalcOpenOffice.org ImpressOpenOffice.org DrawOpenOffice.org MathOpenOffice.org BaseOpenOffice.org Macros and APIOpenOffice.org Code Snippets Community Forums----------------General DiscussionSite Feedback
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