Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default refering to worksheet cell under shaoe object

TIA for your time
Is there a way to ask a shape object which worksheet cell it is positioned
over?
--
David
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default refering to worksheet cell under shaoe object

Hi David

With ActiveSheet.Shapes(1)
MsgBox .TopLeftCell.Address, , .Name
End With

Regards,
Peter T

"David" wrote in message
...
TIA for your time
Is there a way to ask a shape object which worksheet cell it is positioned
over?
--
David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default refering to worksheet cell under shaoe object

Thanks for your response Peter
--
David


"Peter T" wrote:

Hi David

With ActiveSheet.Shapes(1)
MsgBox .TopLeftCell.Address, , .Name
End With

Regards,
Peter T

"David" wrote in message
...
TIA for your time
Is there a way to ask a shape object which worksheet cell it is positioned
over?
--
David




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default refering to worksheet cell under shaoe object

Peter
Thanks again for your response
Along the same lines, when I return the X & Y co-ords from a mouse down
event, can i refer to the worksheet cell (where the mouse was clicked) using
the X & Y values?
--
David


"Peter T" wrote:

Hi David

With ActiveSheet.Shapes(1)
MsgBox .TopLeftCell.Address, , .Name
End With

Regards,
Peter T

"David" wrote in message
...
TIA for your time
Is there a way to ask a shape object which worksheet cell it is positioned
over?
--
David




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default refering to worksheet cell under shaoe object

David - What object's mouse down event that returns X & Y co-ords are you
referring to. There isn't one for cells or for shapes other than ActiveX
controls. With cells there is the selection change event from which you can
calculate left & top offsets of the active cell from A1. But that's not the
same as X & Y screen co-ords, if that's what you are trying to get.

Regards,
Peter T

"David" wrote in message
...
Peter
Thanks again for your response
Along the same lines, when I return the X & Y co-ords from a mouse down
event, can i refer to the worksheet cell (where the mouse was clicked)

using
the X & Y values?
--
David


"Peter T" wrote:

Hi David

With ActiveSheet.Shapes(1)
MsgBox .TopLeftCell.Address, , .Name
End With

Regards,
Peter T

"David" wrote in message
...
TIA for your time
Is there a way to ask a shape object which worksheet cell it is

positioned
over?
--
David








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default refering to worksheet cell under shaoe object

Sorry Peter,
I'm refering to a MouseDown event on an activeX image control. I have
several of these controls on the worksheet and would like to return a
reference to the cell underneath the control that was clicked
--
David


"Peter T" wrote:

David - What object's mouse down event that returns X & Y co-ords are you
referring to. There isn't one for cells or for shapes other than ActiveX
controls. With cells there is the selection change event from which you can
calculate left & top offsets of the active cell from A1. But that's not the
same as X & Y screen co-ords, if that's what you are trying to get.

Regards,
Peter T

"David" wrote in message
...
Peter
Thanks again for your response
Along the same lines, when I return the X & Y co-ords from a mouse down
event, can i refer to the worksheet cell (where the mouse was clicked)

using
the X & Y values?
--
David


"Peter T" wrote:

Hi David

With ActiveSheet.Shapes(1)
MsgBox .TopLeftCell.Address, , .Name
End With

Regards,
Peter T

"David" wrote in message
...
TIA for your time
Is there a way to ask a shape object which worksheet cell it is

positioned
over?
--
David






  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default refering to worksheet cell under shaoe object

An Image control will have a click event. Obviously, since you write the
code for the click event, you already know which control it belongs to. You
can then use that information to get the topleftcell.

Private Sub Image1_Click()
MsgBox Image1.TopLeftCell.Address
End Sub


--
Regards,
Tom Ogilvy

"David" wrote in message
...
Sorry Peter,
I'm refering to a MouseDown event on an activeX image control. I have
several of these controls on the worksheet and would like to return a
reference to the cell underneath the control that was clicked
--
David


"Peter T" wrote:

David - What object's mouse down event that returns X & Y co-ords are

you
referring to. There isn't one for cells or for shapes other than ActiveX
controls. With cells there is the selection change event from which you

can
calculate left & top offsets of the active cell from A1. But that's not

the
same as X & Y screen co-ords, if that's what you are trying to get.

Regards,
Peter T

"David" wrote in message
...
Peter
Thanks again for your response
Along the same lines, when I return the X & Y co-ords from a mouse

down
event, can i refer to the worksheet cell (where the mouse was clicked)

using
the X & Y values?
--
David


"Peter T" wrote:

Hi David

With ActiveSheet.Shapes(1)
MsgBox .TopLeftCell.Address, , .Name
End With

Regards,
Peter T

"David" wrote in message
...
TIA for your time
Is there a way to ask a shape object which worksheet cell it is

positioned
over?
--
David








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Refering cell to the worksheet name Dave Excel Worksheet Functions 6 October 1st 08 03:19 PM
Refering to a sheet in a cell Jarek Kujawa[_2_] Excel Discussion (Misc queries) 0 July 31st 08 11:06 AM
Can you name a worksheet by refering to a cell reference or range o2bing Excel Discussion (Misc queries) 10 March 21st 08 07:18 AM
Refering a cell Arun Kumar Saha Excel Worksheet Functions 2 June 18th 07 12:48 PM
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error [email protected] Excel Discussion (Misc queries) 4 September 25th 06 01:35 PM


All times are GMT +1. The time now is 02:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"