Greetings,
I have a situation where I have many cells in the same column (F), that contains data formatted as below:
The first row is data blah blah
and the rest is such as this blah blah
asdfasdfa
asdfasdf
I would like to cycle thru each cell in the column and make just the first row Bold Times New Roman 14 Font.
Is this doable?
Thanks,
Brad
Cell Content Contol
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
-
- Administrator
- Posts: 78487
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Cell Content Contol
Run this macro:
Code: Select all
Sub FormatFirstline()
Dim rng As Range
Dim adr As String
Dim pos As Long
Application.ScreenUpdating = False
Set rng = Range("F:F").Find(What:=vbLf, LookAt:=xlPart)
If Not rng Is Nothing Then
adr = rng.Address
Do
pos = InStr(rng.Value, vbLf)
With rng.Characters(1, pos - 1)
.Font.Bold = True
.Font.Size = 14
.Font.Name = "Times New Roman"
End With
Set rng = Range("F:F").Find(What:=vbLf, After:=rng, LookAt:=xlPart)
If rng Is Nothing Then Exit Do
Loop Until rng.Address = adr
End If
Application.ScreenUpdating = True
End Sub
Best wishes,
Hans
Hans
-
- 4StarLounger
- Posts: 538
- Joined: 30 Mar 2010, 18:49
- Location: United States
Re: Cell Content Contol
Oh Man.!! Super sweet. Just ran and woohoo I'm impressed.
Thanks Brad
Thanks Brad