Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to creat a spreadsheet calendar for 2006 with the following VBA
code. Dim i, j, k As Integer For i = 1 To 12 dt = DateSerial(2005, i + 1, 1) For j = 1 To Day(DateSerial(2006, i + 1, 0)) week_Text= Text(Date(2006,i,1),"ddd")) Cells(i + 6, j).Value = week_Text If week_Text = "Sat" Or week_Text = "Sun" Then For k = i To i + 5 Cells(k, j).Select With Selection.Interior .ColorIndex = 48 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With Next Else End If Next Next End Sub I got an error message on "week_Text= Text(Date(2006,i,1),"ddd"))". Would anyone help? Thanks in advance. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Proper syntex to use | Excel Discussion (Misc queries) | |||
Syntex Error ?? | Excel Discussion (Misc queries) | |||
How do I correct the #DIV/0! error? | Excel Worksheet Functions | |||
Date format within a text syntex? | Excel Worksheet Functions | |||
What syntex to find text | Excel Programming |