ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Text formatting - Change Font Size (https://www.excelbanter.com/excel-programming/382378-text-formatting-change-font-size.html)

dd

Text formatting - Change Font Size
 
How do I change the font size of text that is Times New Roman only, to 9pt?

Dylan




Dave Miller

Text formatting - Change Font Size
 
Dylan,

try this:

Sub NTR_9pt()
Dim r, c As Range
Set r = Selection 'Or any other range you want
For Each c In r
If c.Font.Name = "Times New Roman" Then
c.Font.Size = 9
End If
Next
End Sub

David Miller


Tom Ogilvy

Text formatting - Change Font Size
 
Are we talking the whole cell or Rich Text formatting.

If the latter, then turn on the macro recorder while you do it manually and
this will show you the basic code construct using the Characters collection.
You can then adapt it within an if then construct to determine the Font.Name
for each character in the cell and make the change where appropriate.

--
Regards,
Tom Ogilvy


"dd" wrote:

How do I change the font size of text that is Times New Roman only, to 9pt?

Dylan





dd

Text formatting - Change Font Size
 
Thank you both.

I managed to do it with the find-replace command.

Regards
Dylan



Tom Ogilvy

Text formatting - Change Font Size
 
If your not looking for programming solutions or need one time how do I do
this type questions answered, you might want to post in

Microsoft.public.excel.misc

or
Microsoft.public.excel

or
Microsoft.public.Excel.newuser

--
Regards,
Tom Ogilvy




"dd" wrote:

Thank you both.

I managed to do it with the find-replace command.

Regards
Dylan




dd

Text formatting - Change Font Size
 
Point taken,

I had a lapse in concentration and came to this group through habit.

Click-whirr

Regards
Dylan

"Tom Ogilvy" wrote in message
...
If your not looking for programming solutions or need one time how do I do
this type questions answered, you might want to post in

Microsoft.public.excel.misc

or
Microsoft.public.excel

or
Microsoft.public.Excel.newuser

--
Regards,
Tom Ogilvy




"dd" wrote:

Thank you both.

I managed to do it with the find-replace command.

Regards
Dylan







All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com