View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
p45cal[_85_] p45cal[_85_] is offline
external usenet poster
 
Posts: 1
Default UDF help to centre and bold


You'rte nearly theFunction CenterAndBold(somerange)
With somerange
.HorizontalAlignment = xlCenter
.Font.Bold = True
End With
End Function

Sub test()
CenterAndBold Selection
For i = 1 To 13 Step 2
CenterAndBold Cells(i, 2)
Next
End Sub
It won't work as a worksheet function though.

Perhaps you're looking for the likes of:If
sh1.Cells(rw, 6) = cell.Offset(0, 10) Then CenterAndBold sh1.Cells(rw,
6)
which should also work.


--
p45cal

*p45cal*
------------------------------------------------------------------------
p45cal's Profile: http://www.thecodecage.com/forumz/member.php?userid=558
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=130222