| View previous topic :: View next topic |
| Author |
Message |
richhill OOo Advocate


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) |
|
| Back to top |
|
 |
David Super User


Joined: 24 Oct 2003 Posts: 5668 Location: Canada
|
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. |
|
| Back to top |
|
 |
DannyB Moderator


Joined: 02 Apr 2003 Posts: 3991 Location: Lawrence, Kansas, USA
|
|
| Back to top |
|
 |
|