Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating Custom Toolbars

Hello,
Can anyone help me in understanding how to create a custom toolbar t
have my own format???I have taken some help from an excel text book an
created this code below....But I am not happy with the way its workin
cos its not doing what I am loking for....

I am trying to add either another control/button to the built in lis
in the Category Menu of the formatcells toolbar
For eg:
we have built in categories like General,Number,Accounting etc et
....Can I add my own button to this list or...can add my own format t
the list in custom format?? Herz what I have....An
revisions/modifications to this code to make it work the way I wan
greatly appreciated.....
Sub MakeCustomFormatDisplay()
Dim Tbar As CommandBar
Dim NewBtn As CommandBarButton
On Error Resume Next
CommandBars("Custom Format").Delete
On Error GoTo 0

Set Tbar = CommandBars.Add
With Tbar
.Name = "Custom Format"
.Visible = True
End With
Set NewBtn = CommandBars("Custo
Format").Controls.Add(Type:=msoControlButton)
With NewBtn
.Caption = " "
.OnAction = "FormatChanger"
.TooltipText = "Click to change the Custom format"
.Style = msoButtonCaption
End With
Call UpdateToolbar
End Sub
Sub UpdateToolbar()
On Error Resume Next
CommandBars("Custom Format").Controls(1).Caption
ActiveCell.CustomFormat
End Sub
Sub FormatChanger()
Dim r As Range

For Each r In Selection

If IsNumeric(r.Value) Then
Select Case r.Value
Case 1
r.Value = "Read Only"
Case 2
r.Value = "Assessor"
Case 3
r.Value = "Reviewer"

End Select
End If
Next

Call UpdateToolbar
End Su

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Creating Custom Toolbars

Also, please don't post the same question in two different groups. I have
attempted to answer your question elsewhere.

--

Vasant


"excel_naive " wrote in message
...
Hello,
Can anyone help me in understanding how to create a custom toolbar to
have my own format???I have taken some help from an excel text book and
created this code below....But I am not happy with the way its working
cos its not doing what I am loking for....

I am trying to add either another control/button to the built in list
in the Category Menu of the formatcells toolbar
For eg:
we have built in categories like General,Number,Accounting etc etc
...Can I add my own button to this list or...can add my own format to
the list in custom format?? Herz what I have....Any
revisions/modifications to this code to make it work the way I want
greatly appreciated.....
Sub MakeCustomFormatDisplay()
Dim Tbar As CommandBar
Dim NewBtn As CommandBarButton
On Error Resume Next
CommandBars("Custom Format").Delete
On Error GoTo 0

Set Tbar = CommandBars.Add
With Tbar
Name = "Custom Format"
Visible = True
End With
Set NewBtn = CommandBars("Custom
Format").Controls.Add(Type:=msoControlButton)
With NewBtn
Caption = " "
OnAction = "FormatChanger"
TooltipText = "Click to change the Custom format"
Style = msoButtonCaption
End With
Call UpdateToolbar
End Sub
Sub UpdateToolbar()
On Error Resume Next
CommandBars("Custom Format").Controls(1).Caption =
ActiveCell.CustomFormat
End Sub
Sub FormatChanger()
Dim r As Range

For Each r In Selection

If IsNumeric(r.Value) Then
Select Case r.Value
Case 1
r.Value = "Read Only"
Case 2
r.Value = "Assessor"
Case 3
r.Value = "Reviewer"

End Select
End If
Next

Call UpdateToolbar
End Sub


---
Message posted from http://www.ExcelForum.com/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Toolbars Tami Excel Worksheet Functions 1 August 7th 09 04:14 AM
Custom Toolbars..? Andrew[_9_] Excel Discussion (Misc queries) 2 January 20th 09 12:54 AM
Custom toolbars Ian Anderson Excel Discussion (Misc queries) 0 February 18th 06 08:04 PM
Creating toolbars thru VBA mike_mike Excel Discussion (Misc queries) 2 August 10th 05 09:02 AM
Custom ToolBars Julian[_3_] Excel Programming 1 January 8th 04 06:22 PM


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"