ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   TOOLBAR FOR A MACRO (https://www.excelbanter.com/excel-discussion-misc-queries/193542-toolbar-macro.html)

FARAZ QURESHI

TOOLBAR FOR A MACRO
 
I need to make a button on a new TOOLBAR for starting a specific macro. How
to do the same?

All help shall be appreciated.

Thanx in advance.

--

Best Regards,
FARAZ A. QURESHI

FARAZ QURESHI

TOOLBAR FOR A MACRO
 
The macro is actually a part of a collection of add-in codes in a file.
--

Best Regards,
FARAZ A. QURESHI


"FARAZ QURESHI" wrote:

I need to make a button on a new TOOLBAR for starting a specific macro. How
to do the same?

All help shall be appreciated.

Thanx in advance.

--

Best Regards,
FARAZ A. QURESHI


Jim Rech

TOOLBAR FOR A MACRO
 
This is an example of creating a new button on the Worksheet menu bar. If
you wanted to use your own commandbar use the Commandbars.Add method.
Examples are in VBA Help and all over the web.

Sub AddBtn()
DelBtn
With CommandBars("Worksheet Menu Bar").Controls.Add(msoControlButton, ,
, , True)
.Caption = "CS_Override"
.TooltipText = "Mark/unmark selected range as override"
.OnAction = "MarkAsOverride"
.FaceId = 6743
.BeginGroup = True
End With
End Sub

Sub DelBtn()
On Error Resume Next
CommandBars("Worksheet Menu Bar").Controls("CS_Override").Delete
End Sub


--
Jim
"FARAZ QURESHI" wrote in message
...
| The macro is actually a part of a collection of add-in codes in a file.
| --
|
| Best Regards,
| FARAZ A. QURESHI
|
|
| "FARAZ QURESHI" wrote:
|
| I need to make a button on a new TOOLBAR for starting a specific macro.
How
| to do the same?
|
| All help shall be appreciated.
|
| Thanx in advance.
|
| --
|
| Best Regards,
| FARAZ A. QURESHI



Dave Peterson

TOOLBAR FOR A MACRO
 
For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

In xl2007, those toolbars and menu modifications will show up under the addins.

FARAZ QURESHI wrote:

I need to make a button on a new TOOLBAR for starting a specific macro. How
to do the same?

All help shall be appreciated.

Thanx in advance.

--

Best Regards,
FARAZ A. QURESHI


--

Dave Peterson


All times are GMT +1. The time now is 08:47 PM.

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