Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
TIA for your time
Is there a way to ask a shape object which worksheet cell it is positioned over? -- David |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Refering cell to the worksheet name | Excel Worksheet Functions | |||
Refering to a sheet in a cell | Excel Discussion (Misc queries) | |||
Can you name a worksheet by refering to a cell reference or range | Excel Discussion (Misc queries) | |||
Refering a cell | Excel Worksheet Functions | |||
Macro to Create New Worksheet and Reference Cell in Old Worksheet As Tab Name - "Object Required" Error | Excel Discussion (Misc queries) |