View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Help with code please

Gary,

Add check for valid date:

If IsDate(wEndval) Then
' this puts the day in the cell if it's a weekend
If Weekday(wEndval, 2) 5 Then
cell.Value = Format(wEndval, "ddd")
cell.HorizontalAlignment = xlCenter
cell.Font.Bold = True
End If
End If

HTH