ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to know be button in activecell (https://www.excelbanter.com/excel-programming/350843-how-know-button-activecell.html)

x taol

how to know be button in activecell
 


i want to know wheter is be or not a button in specific cell using vba.

*** Sent via Developersdex http://www.developersdex.com ***

Leith Ross[_470_]

how to know be button in activecell
 

Hello X toal,

Here is a macro that checks if the Active Cell is covered partially or
totally by a Shape object or Active X control (OLE object).

Sub IsCellCovered()

Dim Shp
Dim ShpRng As Range

For Each Shp In ActiveSheet.Shapes
Set ShpRng = Range(Shp.TopLeftCell, Shp.BottomRightCell)
If Not Application.Intersect(ShpRng, ActiveCell) Is Nothing =
True Then
MsgBox Shp.Name & " is covering part or all of the cell " &
ActiveCell.Address
Exit Sub
End If
Next Shp

End Sub

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=502736


Tim Williams

how to know be button in activecell
 
Check the TopLeftCell property

Tim

--
Tim Williams
Palo Alto, CA


"x taol" wrote in message
...


i want to know wheter is be or not a button in specific cell using vba.

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com