ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   menu (https://www.excelbanter.com/excel-programming/376115-menu.html)

x taol

menu
 

Application.CommandBars("Sheet").Controls(2).Copy
Bar:=Application.CommandBars(1), Befo=11, caption:="shtHide",
style:="OnlyText"

But, the code doesn't work.
How can I?


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

Ken Puls

menu
 
What exactly are you trying to do? You seem to be mixing up sheets and
commandbars here.

Can you explain your goal a little more clearly?

Ken Puls, CMA - Microsoft MVP (Excel)
www.excelguru.ca

x taol wrote:
Application.CommandBars("Sheet").Controls(2).Copy
Bar:=Application.CommandBars(1), Befo=11, caption:="shtHide",
style:="OnlyText"

But, the code doesn't work.
How can I?


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


x taol

menu
 
With Application
.CommandBars("Sheet").Controls(2).Copy .CommandBars(1), 4
End With

this code work well.

but i want to change the name with "shtHid" using VBA.

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

Ken Puls

menu
 
Try this:

With Application
.CommandBars("Sheet").Controls(2).Copy .CommandBars(1), 4
.CommandBars(1).Controls(4).Caption = "shtHid"
End With

Is that what you meant?

Ken Puls, CMA - Microsoft MVP (Excel)
www.excelguru.ca

x taol wrote:
With Application
.CommandBars("Sheet").Controls(2).Copy .CommandBars(1), 4
End With

this code work well.

but i want to change the name with "shtHid" using VBA.

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


x taol

menu
 
thank you very much ken,
by the way,,

Set mb = Application.CommandBars(1)
With mb.Controls
'all show filter
.Add Type:=msoControlButton, ID:=900, Befo=11
end with

I want to change the name with "all_sho_filt" and set always only text.

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


All times are GMT +1. The time now is 09:21 PM.

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