ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   shapes on a sheet (https://www.excelbanter.com/excel-programming/326934-shapes-sheet.html)

JT[_2_]

shapes on a sheet
 
I have several rectangles that I use as buttons on my
spreadsheet to kick off certain macros.

Can I enable and disable these rectangles like you can do
with buttons on a form?

Any help with the syntax would be appreciated. Thanks...


Tom Ogilvy

shapes on a sheet
 
A rectangle does have an enabled property, but it doesn't seem to do much.
You could, however, set it with your code, then have the click event check
the value of that property

Sub Rectangle_click()
sName = Application.Caller
Set rect = ActiveSheet.Rectangles(sName)
If rect.Enabled Then
MsgBox rect.Name & ", Yes I am enabled"
else
msgbox "I am not able to help at this time"
End If
End Sub


activesheet.shapes(1).controlformat.Enabled = false
activesheet.shapes("Rectangle 1").controlformat.Enabled = false
activsheet.Rectangles("Rectangle 1").Enabled = False


--
Regards,
Tom Ogilvy


"JT" wrote in message
...
I have several rectangles that I use as buttons on my
spreadsheet to kick off certain macros.

Can I enable and disable these rectangles like you can do
with buttons on a form?

Any help with the syntax would be appreciated. Thanks...




anonymousA

shapes on a sheet
 
Hi,

you can use the sheet protection and protect the objects only. It will
allow you doing everything you want in the sheet but won't allow
grabbing the objects.

Regards

JT a écrit :
I have several rectangles that I use as buttons on my
spreadsheet to kick off certain macros.

Can I enable and disable these rectangles like you can do
with buttons on a form?

Any help with the syntax would be appreciated. Thanks...



All times are GMT +1. The time now is 07:18 PM.

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