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

I need a macro that changes fonts in an excel document from:

Goudy Old Style to Garamond
-and-
Avenir 45 Book to Gill Sans MT
-and-
Times New Roman to Garamond

If there are other fonts in the document I want to leave them as is.
I
am only concerned with the above 2 fonts.

I have a ton of documents to do which is why I want a macro for it.

Thanks in advance for your help.

Eli

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Macro to change font

If you're using xl2002+, you can use Edit|Replace and click the options button
and change formats.

If you're using xl2k and below, you'll have to loop through all the cells in the
usedrange.

And if you actually use character by character formatting, you'll have to loop
through each cell and loop through each character.



wrote:

I need a macro that changes fonts in an excel document from:

Goudy Old Style to Garamond
-and-
Avenir 45 Book to Gill Sans MT
-and-
Times New Roman to Garamond

If there are other fonts in the document I want to leave them as is.
I
am only concerned with the above 2 fonts.

I have a ton of documents to do which is why I want a macro for it.

Thanks in advance for your help.

Eli


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Macro to change font

Thanks Dave for pointing me in the right direction. For anyone reading
this in the future here is the code that Excel 2003 generated with the
macro recorder. So change the font names to the ones you want to use.

Sub Macro1()
'
' Macro1 Macro
'

'
With Application.FindFormat.Font
.Name = "Times New Roman"
.Subscript = False
End With
With Application.ReplaceFormat.Font
.Name = "Garamond"
.Subscript = False
End With
Cells.Replace What:="", Replacement:="", LookAt:=xlPart,
SearchOrder:= _
xlByRows, MatchCase:=False, SearchFormat:=True,
ReplaceFormat:=True
End Sub

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
macro that will change the font of a cell if i change a value jk Excel Discussion (Misc queries) 2 July 29th 08 04:39 PM
A macro to change font size Mahadevan Swamy Excel Programming 1 July 17th 07 02:54 PM
change font using macro L Scholes Excel Programming 2 April 5th 06 07:51 PM
Macro to Change Font Color Daniel R. Young Excel Programming 2 October 10th 05 08:58 PM
Where to stick macro to change default comment font? [email protected] Excel Discussion (Misc queries) 1 January 1st 05 12:57 AM


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

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"