Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Rows to Repeat at Top - Formatting Multiples | Excel Worksheet Functions | |||
conditional formatting - repeat formula | Excel Worksheet Functions | |||
Repeat title to top of each worksheet | Excel Worksheet Functions | |||
Title Cut Off if Rows to Repeat & Columns to Repeat are Both Selec | Excel Discussion (Misc queries) | |||
Problem with Chart Title Formatting | Charts and Charting in Excel |