View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Formatting using Macro

Hi,

Right click your sheet tab, view code and paste this in and run it

Sub sonic()
LastRow = Cells(Cells.Rows.Count, "B").End(xlUp).Row
Set myrange = Range("B1:B" & LastRow) '<Change to suit
For Each c In myrange
Select Case c.Value
Case Is = "Tb"
icolor = 33
fcolor = 2
Case Is = "Tc"
icolor = 6
fcolor = xlAutomatic
Case Is = "Td"
icolor = 5
fcolor = 1
Case Else
icolor = xlNone
fcolor = xlAutomatic
End Select
c.EntireRow.Interior.ColorIndex = icolor
c.EntireRow.Font.ColorIndex = fcolor
Next
End Sub


Mike

"simplymidori" wrote:

I have done some rework to my tool and the macro I have now no longer works
for my report.

I'm looking to see if someone can help me on a couple macros.

Macro 1

If column B contains "Tb"
Row background color BLUE , Text color WHITE and BOLD

If column B contains "Tc"
Row background color YELLOW

If column B contains "Td"
Text color BLACK and BOLD

__________________________

I'll then run another macro which I have to breakout the report into
multiple worksheets

__________________________

Macro 2

Run macro on ALL worksheets except for "TRACKER" worksheet
If column B contains "Total" insert 2 rows below.

Thank you in advance.