View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Conditional Formationg Macro

Hi Glimmer23,

Try:

'===================
Public Sub FormatJune()
Dim sh As Worksheet
Dim rng As Range
Dim rCell As Range

Set sh = Thisworkbook.Sheets("Sheet1") '<<======= CHANGE
Set rng = sh.Range("B5:BM5")

For Each rCell In rng.Cells
If Month(rCell.Value) = 6 Then 'June
With rCell.Resize(sh.UsedRange.Rows.Count).Font
.Bold = True
.Size = 14
End With
End If
Next rCell

End Sub

''<<'===================


---
Regards,
Norman



wrote in message
ups.com...
Hi - hopefully this is something simple:

I have a block fo data - F5:BM265. what i am trying to do is create a
macro that checks row 5 at the top of each column (which is a month)
and then if the month is june. make the column a certain format (bold
and larger font).

Yes conditional formating can do it - but if I want to change the
special formatting i would ahve to go change 60 columns... oh and yes
the dates would changes so it wouldnt be just 5 columns would have to
be all 60.

got no idea where to start on this can anyone help me?!

thanks in advance