Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Toggle Font Style Macro


That's helpful. My code now looks like this.

Sub BackgroundToggle()
Dim FontColor As Long
Dim FontBold As Boolean
FontColor = Selection.Font.Color
FontBold = Selection.Font.Bold
If Selection.Interior.ColorIndex = xlNone Then
Selection.Interior.ColorIndex = 2 'white
ElseIf Selection.Interior.ColorIndex = 2 Then
Selection.Interior.ColorIndex = 35 'yellow
ElseIf Selection.Interior.ColorIndex = 35 Then
Selection.Interior.ColorIndex = 1 'black
Selection.Font.Color = RGB(255, 255, 255)
Selection.Font.Bold = True
ElseIf Selection.Interior.ColorIndex = 1 Then
Selection.Interior.ColorIndex = 48 'blue
Selection.Font.Color = RGB(255, 255, 255)
Selection.Font.Bold = True
Else
Selection.Interior.ColorIndex = xlNone
Selection.Font.Bold = FontBold
Selection.Font.Color = FontColor
End If
End Sub

It's still not working. Even when the selection is not a mixed bag, i
doesn't work.

Any more ideas

--
GK8053
-----------------------------------------------------------------------
GK80535's Profile: http://www.excelforum.com/member.php...fo&userid=1546
View this thread: http://www.excelforum.com/showthread.php?threadid=27213

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
Changing font style and color using VBA Spongie Excel Discussion (Misc queries) 3 September 30th 09 08:34 PM
Change the Font Style in VBA justme0010[_2_] Excel Discussion (Misc queries) 1 January 15th 08 04:07 AM
Toggle Font Style Macro GK80535[_4_] Excel Programming 2 October 25th 04 09:33 PM
Toggle Font Style Macro GK80535[_3_] Excel Programming 1 October 25th 04 07:10 PM
Toggle Font Style Macro GK80535[_2_] Excel Programming 2 October 25th 04 06:31 PM


All times are GMT +1. The time now is 11:56 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"