PC Review


Reply
Thread Tools Rate Thread

To determine the font of a cell and change it if required

 
 
Subodh
Guest
Posts: n/a
 
      6th May 2010
I need to have a sub
The sub checks range A1 to A10
and determine the font of the cell
IF the font is not Times new roman
it makes the font to times new roman
and the font size to 10
also, if the font is not installed in the system
it should give a message.
ANy tips will be appreciated
Thanks in advance.
 
Reply With Quote
 
 
 
 
Subodh
Guest
Posts: n/a
 
      6th May 2010
On May 6, 8:33*pm, Subodh <getsub...@gmail.com> wrote:
> I need to have a sub
> The sub checks range A1 to A10
> and determine the font of the cell
> IF the font is not Times new roman
> it makes the font to times new roman
> and the font size to 10
> also, if the font is not installed in the system
> it should give a message.
> ANy tips will be appreciated
> Thanks in advance.


I tried the follwing
Sub mysub()
x = ActiveCell.Font.Name
If x <> "Mercantile" Then
MsgBox "Not Mercantile Font."
With Selection.Font
.Name = "Mercantile"
.Size = 11
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
'With Selection.Font
' .Name = "Mercantile"
' .Size = 11

End If
'End If
End Sub

Function mysubs(argname As Variant) As Variant
mysubs = argname * 2
If Application.Caller.Address = ActiveCell.Address Then Call mysub
End Function

But, it didn't work.
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cell font color when cell is clicked aileen Microsoft Excel Programming 9 27th Apr 2010 08:53 PM
Change Font Color in cell Based on another cell value =?Utf-8?B?Sm9obg==?= Microsoft Excel Programming 2 18th Nov 2005 05:28 PM
determine font color in cell deadfish Microsoft Excel Worksheet Functions 1 16th Aug 2004 12:24 PM
How To Trap Cell Value Change Event so determine XL calc sequence? Alex Lai Microsoft Excel Programming 4 30th Jun 2004 12:49 PM
Change Cell Data of a Required Column jonathan Microsoft Excel Programming 2 9th Jan 2004 11:44 AM


Features
 

Advertising
 

Newsgroups
 


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