LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
gvm
 
Posts: n/a
Default changing font style in a complex worksheet function

I have previously had help to change the font style of a fairly simple
worksheet function. Now I want to do similarin a worksheet function that has
four character strings interspersed with functions. The code I use follows
and the first problem I get is a compile error: there is a problem with the
CELL function. Thanks again in anticipation, I appreciate the support of this
community so much, it's excellent ... Greg

Private Sub Worksheet_Calculate()
Application.EnableEvents = False
Range("A5").Value = "Usage Instruction: Vary contribution rate (cell " &
Substitute(CELL("address", D10), "$", "") & ") in order to set Actual Annuity
(" & Substitute(CELL("address", D24), "$", "") & ") to the value of the
Required Annuity (" & Substitute(CELL("address", D19), "$", "") & ") by
pressing the button above."

' The following code changes the style of the words CONTRIBUTION RATE in the
first phrase in A5 to bold and green
With Range("A5").Characters(Start:=25, Length:=17).Font
.FontStyle = "Bold"
.ColorIndex = 50

' The following code attempts to change the style of the words ACTUAL
ANNUITY in the second phrase in A5 to bold and green
With Range("A5").Characters(Start:=68, Length:=14).Font
.FontStyle = "Bold"
.ColorIndex = 50

' The following code attempts to change the style of the words REQUIRED
ANNUITY in the third phrase in A5 to bold and green
With Range("A5").Characters(Start:=106, Length:=16).Font
.FontStyle = "Bold"
.ColorIndex = 50
End With
Application.EnableEvents = True
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
font style of worksheet functions gvm Excel Worksheet Functions 4 January 20th 06 08:30 PM
changing type style and colour within a worksheet function gvm Excel Worksheet Functions 0 July 25th 05 03:03 AM
how do i get font style back on toolbar? melissa Excel Discussion (Misc queries) 2 July 18th 05 08:55 PM
Changing the Normal Style Randy Maheux Excel Discussion (Misc queries) 1 December 27th 04 03:13 PM
Changing default font for all comments abbylulu2 Excel Discussion (Misc queries) 1 December 20th 04 06:41 PM


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