Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Repeat Title Formatting With Macro


Hi

Not the most gifted user of macros - can record something basic, but a
hoping to develop a bit more talent.
Anyway, need advice with the following:

I have a number of reports that i import to excel - within thes
reports are recurring titles over different accounts.

I want a macro that will format each occurance of a title in a prett
way (i.e. bold, 12 font, wrap text, row height 34).
Unfortunatly the title headings do not occur at regular intervals eac
time the report is run as it depends on the number of order for eac
account.

Any help would be greatly appreciated.

Thanks

Ti

--
iambalro
-----------------------------------------------------------------------
iambalrog's Profile: http://www.excelforum.com/member.php...fo&userid=2697
View this thread: http://www.excelforum.com/showthread.php?threadid=40188

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Repeat Title Formatting With Macro

Tim, try the following.

Sub FormatTitles()
Dim firstCell As Range
Dim nextCell As Range
Dim TitleStr As String
TitleStr = "Title Text"
Set firstCell = Cells.Find(What:=TitleStr, After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlWhole)
If Not firstCell Is Nothing Then
FormatCell TitleCell:=firstCell
Set nextCell = Cells.FindNext(After:=firstCell)
While nextCell.Address < firstCell.Address
FormatCell TitleCell:=nextCell
Set nextCell = Cells.FindNext(After:=nextCell)
Wend
End If
End Sub

Sub FormatCell(TitleCell As Range)
TitleCell.Font.Bold = True

'...

End Sub


"iambalrog" wrote
in message ...

Hi

Not the most gifted user of macros - can record something basic, but am
hoping to develop a bit more talent.
Anyway, need advice with the following:

I have a number of reports that i import to excel - within these
reports are recurring titles over different accounts.

I want a macro that will format each occurance of a title in a pretty
way (i.e. bold, 12 font, wrap text, row height 34).
Unfortunatly the title headings do not occur at regular intervals each
time the report is run as it depends on the number of order for each
account.

Any help would be greatly appreciated.

Thanks

Tim


--
iambalrog
------------------------------------------------------------------------
iambalrog's Profile:
http://www.excelforum.com/member.php...o&userid=26977
View this thread: http://www.excelforum.com/showthread...hreadid=401889



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
Rows to Repeat at Top - Formatting Multiples Val Excel Worksheet Functions 2 July 24th 09 06:11 PM
conditional formatting - repeat formula Aaron Hodson \(Coversure\) Excel Worksheet Functions 7 April 29th 08 02:02 PM
Repeat title to top of each worksheet Starla Excel Worksheet Functions 4 July 18th 07 04:36 PM
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec unibaby Excel Discussion (Misc queries) 2 August 24th 05 04:29 PM
Problem with Chart Title Formatting KvnLynch Charts and Charting in Excel 1 January 12th 05 03:15 AM


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