LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Question On Formatting cells

Heloo
Can anyone plzz help me to get this code below working.....All I am looking for is to add another button to custom format toolbar and put my own format.....Any ideas help 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

Select Case r.Value
Case 1
r.Value = "Read Only"
Case 2
r.Value = "Assessor"
Case 3
r.Value = "Reviewer"

End Select

Next

Call UpdateToolbar
End Sub
 
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
condionally formatting based on another cells formatting? Derrick Excel Discussion (Misc queries) 2 July 31st 09 08:05 PM
Formatting cells in a column with conditional formatting? shamor Excel Discussion (Misc queries) 8 May 19th 08 10:11 PM
Formatting Question Matt Excel Discussion (Misc queries) 2 May 15th 08 10:43 PM
Formatting Question Zecarioca Excel Discussion (Misc queries) 4 August 23rd 06 10:30 PM
Formatting Question Carey Abercrombie Excel Worksheet Functions 5 February 23rd 06 07:40 PM


All times are GMT +1. The time now is 02:48 PM.

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

About Us

"It's about Microsoft Excel"