Hiding a Macro Button

ParanoidAndroid

Board Regular
Joined
Jan 24, 2011
Messages
50
Hi Mr Excel

I want to hide a macro button in a certain condition..

I'm pretty sure my problem is the apostrophies ' ' within the inverted commas " " that exist before around the .xls part 'Internal Account.xls'!send_To_Account_Opening

How do i fix this?

Help most appreciated

Code:
If Range("D9") = Sheets("Sheet1").Range("B75") then
    Sheets("Application Form").Shapes("'Internal Account.xls'!send_To_Account_Opening").Hide
  Else
    Sheets("Application Form").Shapes("'Internal Account Application Form.xls'!send_To_Account_Opening").Visible
  End If
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi Mr Excel

I want to hide a macro button in a certain condition..

I'm pretty sure my problem is the apostrophies ' ' within the inverted commas " " that exist before around the .xls part 'Internal Account.xls'!send_To_Account_Opening

How do i fix this?

Help most appreciated

Code:
If Range("D9") = Sheets("Sheet1").Range("B75") then
    Sheets("Application Form").Shapes("'Internal Account.xls'!send_To_Account_Opening").Hide
  Else
    Sheets("Application Form").Shapes("'Internal Account Application Form.xls'!send_To_Account_Opening").Visible
  End If

Is this really the shape name?

("'Internal Account.xls'!send_To_Account_Opening").

It looks more like the macro address than the shape name...
Here is a reference for you to demonstrate the proper syntax. Just make sure your shape name resides inside the parenthesis.

Code:
Sheet1.Shapes("myShape").Visible = msoTrue
Sheet1.Shapes("myShape").Visible = msoFalse
 
Upvote 0
Hi Sthrncali

I dont know...I just right clicked on the macro button and selected assign macro and used what was written in the box..

How do I find the name of the button i have assigned to the macro?
 
Upvote 0
Right click on the macro button and the name of the button will show in the name box ~ Which is at the top and left of the formula bar.

Unless you have given the button a name it will be Button 1, Button 2 or Button X (another number)
 
Upvote 0

Forum statistics

Threads
1,224,534
Messages
6,179,390
Members
452,909
Latest member
VickiS

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top