Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jack Sons
 
Posts: n/a
Default code for changing font

Hi all,

With the code below I want to change all red Wide Latin text in range
A2:F100 into black, bold (in my Dutch version the word for "bold" is "vet"),
Times New Roman.

It will not work at all. What's wrong?

Jack Sons
The Netherlands
------------------------------------------------------------------------------------
Sub Change()

Dim rng As Range
Dim rCell As Range

Set rng = Range("A2:F100")

For Each rCell In rng.Cells

With rCell

If .Font.Name = "Wide Latin" Then
.Font.Name = "Times New Roman"
.Font.ColorIndex = 1
.FontStyle = "vet"
End If

End With

Next rCell

End Sub




  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student
 
Posts: n/a
Default code for changing font

Try using something like:

..Font.Bold = True
--
Gary's Student


"Jack Sons" wrote:

Hi all,

With the code below I want to change all red Wide Latin text in range
A2:F100 into black, bold (in my Dutch version the word for "bold" is "vet"),
Times New Roman.

It will not work at all. What's wrong?

Jack Sons
The Netherlands
------------------------------------------------------------------------------------
Sub Change()

Dim rng As Range
Dim rCell As Range

Set rng = Range("A2:F100")

For Each rCell In rng.Cells

With rCell

If .Font.Name = "Wide Latin" Then
.Font.Name = "Times New Roman"
.Font.ColorIndex = 1
.FontStyle = "vet"
End If

End With

Next rCell

End Sub





  #3   Report Post  
Posted to microsoft.public.excel.misc
Jack Sons
 
Posts: n/a
Default code for changing font

That's it, thanks.

Jack.

"Gary''s Student" schreef in
bericht ...
Try using something like:

.Font.Bold = True
--
Gary's Student


"Jack Sons" wrote:

Hi all,

With the code below I want to change all red Wide Latin text in range
A2:F100 into black, bold (in my Dutch version the word for "bold" is
"vet"),
Times New Roman.

It will not work at all. What's wrong?

Jack Sons
The Netherlands
------------------------------------------------------------------------------------
Sub Change()

Dim rng As Range
Dim rCell As Range

Set rng = Range("A2:F100")

For Each rCell In rng.Cells

With rCell

If .Font.Name = "Wide Latin" Then
.Font.Name = "Times New Roman"
.Font.ColorIndex = 1
.FontStyle = "vet"
End If

End With

Next rCell

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
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Using other workbooks.. DavidMunday Excel Worksheet Functions 2 July 1st 05 07:35 AM
How to run code to change Excel comment font lucrosus Excel Worksheet Functions 1 June 9th 05 01:05 PM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


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