Shading certain columns depending on start day of week.

Good Afternoon,
I have reason to edit the calendar wizard to make it completely automated.  And before anyone says that this isn't used anymore, we've received 2 separate calendar files over the last made from our Finance departments, each making them with Word calendar
wizard highlighting year end dates.  So believe me, the calendar wizard is still very much in use!
Last September, I finally figured out how to automate the first day of the week, though.  I have 2 templates now, one for Monday as first day and one for Sunday being the first day of the week.
The only thing missing is to automate the shading so that the columns for Saturday and Sunday are shaded with light grey, and since it's automation we're talking about, only those cells in the columns with a number in them.
I know it's do-able, I'm just not a vb expert, only being able to handle editing simple macros.
But I understand that since I had some help with the macros and they might have changed from the original to some degree, that I should post the code.  Is this correct?  I hope that it is.
' WORD 97 WIZARD
' Calendar Wizard Specific Code
Option Explicit
' CONSTANT DECLARATIONS
'=============================== LOCALIZATION BLOCK ===============================
' Localization Note: iWeekStartDay is the starting day of the week (Sun = 0, Mon = 1, ...Sat = 6)
Public Const iWeekStartDay As Integer = 1
' Banter strings
Public Const strWarnYearReq As String = "Both starting and ending years are required."
Public Const strWarnMinExceeded As String = "The year can not be before 1900."
Public Const strWarnMaxExceeded As String = "The year can not be after 4095."
Public Const strWarnRangeExceeded As String = "The calendar is limited to 120 months (10 years)."
Public Const strAppCaptionPart1 As String = "Calendar: "
Public Const strAppCaptionPart1b As String = ""
Public Const strAppCaptionPart2 As String = ", "
Public Const strAppCaptionPart3 As String = " to "
Public Const strAppCaptionPart4 As String = ", "
' Status messages
Public Const strStatusIntro As String = "Creating Calendar..."
Public Const strStatusPart1 As String = "Creating "
Public Const strStatusPart2 As String = ", "
Public Const strStatusPart3 As String = "..."
' Assistant
Public Const strCallBackHeading As String = "Do more with the calendar?"
'Margins for A4 size (if wizard changes pagesize to A4)
Public Const sA4_SHORT_MARGIN As Single = 28.8
Public Const sA4_LONG_MARGIN As Single = 57.6
'Margins for Letter size (if wizard changes pagesize to Letter) in pts
Public Const sLETTER_SHORT_MARGIN As Single = 36
Public Const sLETTER_LONG_MARGIN As Single = 36
'========== END LOCALIZATION BLOCK - DO NOT MAKE CHANGES BELOW THIS LINE ==========
Public Const iYearMin As Integer = 1900
Public Const iYearMax As Integer = 4095
' Bookmark Names - DO NOT LOCALIZE
' Note: No spaces allowed in bookmark names
Public Const strBkMkMonth As String = "Month"
Public Const strBkMkDays As String = "Days"
Public Const strBkMkDayNames As String = "DayNames"
Public Const strBkMkYear As String = "Year"
' Calendar Style Names and Constants
Public Const wzBOXES As Integer = 0
Public Const wzBANNER As Integer = 1
Public Const wzJAZZY As Integer = 2
' Form Control
Public Const wzPAGE_START As Integer = 0
Public Const wzPAGE_STYLE As Integer = 1
Public Const wzPAGE_DIRECTION As Integer = 2
Public Const wzPAGE_MONTHS As Integer = 3
Public Const wzPAGE_FINISH As Integer = 4
'orientation
Public Const iORTN_PORTRAIT As Integer = 0
Public Const iORTN_LANDSCAPE As Integer = 1
' Assistant
Public Const iMAX_PANEL As Integer = 4 ' Number of last panel in MultiPage (First=0)
Public Const iCALL_BACK_COUNT As Integer = 3 ' Number of items in CallBackBalloon (First=1)
'postwizard balloon document variable
Public Const strPOST_WIZ_BLN As String = "Calendar post wizard balloon"
' VARIABLE DECLARATIONS
' General
Public rgstrMonthName(11) As String
Public rgstrDayName(6) As String
Public rgiDaysInMonth(11) As String
Public fDateError As Boolean
Public fCheckValidity As Boolean 'if set then the dates are checked for validity
'variables used in doc. creation
Public str1_TO_28 As String
Public rgsDaysHeight(2, 1, 1) As Single
Public rgsMonthNamesHeight(2, 1, 1) As Single
Public rgstrDaysStyle(2) As String
Public rgstrMonthNamesStyle(2) As String
Public strSTY_BANNER_HDG3 As String
' Assistant
Public rgstrAssistantMsg(iMAX_PANEL + 1) As String
Public rgstrCallBackMsg(iCALL_BACK_COUNT) As String
Public rgstrCallBackTip(iCALL_BACK_COUNT) As String
' Page 1
Public iCalendarStyle As Integer
Public iSavedStyle As Integer
' Page 2
' Page 3
' Page 4
Public Sub InitWizardName(fDummy As Boolean)
strWizName = "Calendar Wizard"
strWizLongName = strWizName
strWizShortName = "Calendar"
End Sub
Public Sub InitWizardStrings(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
'=============================== LOCALIZATION BLOCK ===============================
' Note: this list is indexed 0 - iMAX_PANEL
rgstrAssistantMsg(0) = "The Calendar Wizard helps you create a monthly calendar that you can customize with pictures and events. If you want to track and be reminded of events, you should probably use Microsoft Outlook, Microsoft Schedule+, or Microsoft Exchange."
rgstrAssistantMsg(1) = "Select the look you want for your calendar. The Jazzy style uses the Algerian font. If it is not installed on your system, copy alger.ttf from the Valupack folder on the Microsoft Office CD to your hard drive."
rgstrAssistantMsg(2) = "If you leave room for a picture, Word will insert a placeholder picture that you can replace with any picture you want."
rgstrAssistantMsg(3) = "Your calendar can start on any month, and you can make your calendar shorter than or longer than 12 months. Each month will appear on a different page."
rgstrAssistantMsg(4) = "To change any settings, click Back."
' Note: change constant iCALL_BACK_COUNT if number of items in list changes
rgstrCallBackMsg(0) = "Add, remove, or replace a picture"
rgstrCallBackMsg(1) = "Enter information into the calendar"
rgstrCallBackMsg(2) = "Get Help on Something Else..."
rgstrCallBackTip(0) = "To remove a picture, click on it and then press Delete. To add a picture, click where you want to insert the picture, point to Picture on the Insert menu, and then click From File."
rgstrCallBackTip(1) = "To enter information, click where you want to insert the text and start typing. To move between different dates in the calendar, press Tab to move forward or press Shift+Tab to move to the previous date."
'Load Month Name array
rgstrMonthName(0) = "January"
rgstrMonthName(1) = "February"
rgstrMonthName(2) = "March"
rgstrMonthName(3) = "April"
rgstrMonthName(4) = "May"
rgstrMonthName(5) = "June"
rgstrMonthName(6) = "July"
rgstrMonthName(7) = "August"
rgstrMonthName(8) = "September"
rgstrMonthName(9) = "October"
rgstrMonthName(10) = "November"
rgstrMonthName(11) = "December"
'Load Day Name array LOCALIZATION NOTE: DO NOT CHANGE THE ORDER IN WHICH THESE APPEAR!
' TO CHANGE THE WEEK START DAY, CHANGE THE CONSTANT iWeekStartDay
rgstrDayName(0) = "Sun"
rgstrDayName(1) = "Mon"
rgstrDayName(2) = "Tue"
rgstrDayName(3) = "Wed"
rgstrDayName(4) = "Thu"
rgstrDayName(5) = "Fri"
rgstrDayName(6) = "Sat"
'Load Days In Month array
rgiDaysInMonth(0) = 31
rgiDaysInMonth(1) = 28 'Will not be used - must be calculated for leap year accuracy
rgiDaysInMonth(2) = 31
rgiDaysInMonth(3) = 30
rgiDaysInMonth(4) = 31
rgiDaysInMonth(5) = 30
rgiDaysInMonth(6) = 31
rgiDaysInMonth(7) = 31
rgiDaysInMonth(8) = 30
rgiDaysInMonth(9) = 31
rgiDaysInMonth(10) = 30
rgiDaysInMonth(11) = 31
rgstrDaysStyle(wzBOXES) = "Boxes"
rgstrDaysStyle(wzBANNER) = "Banner"
rgstrDaysStyle(wzJAZZY) = "Jazzy"
rgstrMonthNamesStyle(wzBOXES) = "Boxes Heading2"
rgstrMonthNamesStyle(wzBANNER) = "Banner Heading2"
'we dont set the style for month names in Jazzy style
'the Banner style landscape calendar with picture uses Banner Heading3 style for month names
strSTY_BANNER_HDG3 = "Banner Heading3"
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 0) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 1) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 36
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 36
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 0) = 56
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 1) = 102
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 72
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 71
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 0) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 1) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 55
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 51
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 0) = 64
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 1) = 110
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 81
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 81
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 62
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 59
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 40.5
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 81.8
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 58.2
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 57.5
str1_TO_28 = ""
For i = 1 To 28
str1_TO_28 = str1_TO_28 & CStr(i) & vbTab
Next i
'strip off last tab
str1_TO_28 = Left$(str1_TO_28, Len(str1_TO_28) - 1)
' Location in registry DO NOT LOCALIZE
strRegSettingsKey = strREG_SETTINGS_BASE_KEY & "Calendar Wizard"
Exit Sub
FatalError:
ReportError Err
End Sub ' InitWizardStrings
Public Sub InitWizard(fDummy As Boolean)
' Global Vars
fWizardCallBack = False
fDateError = False
iCurrentPanel = 0
' Initialize strings
InitWizardStrings (True)
' Create a new instance of the form
Set formWizard = New formWizDlg
If formWizard Is Nothing Then GoTo FatalError
formWizard.lblWizName1.Caption = " " & strWizLongName & " "
Exit Sub
FatalError:
DisplayErrorMsg strERR_INIT_FORM
ReportError Err
End Sub
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub SaveDialogValues(fDummy As Boolean)
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
System.Cursor = wdCursorWait
StatusBar = strSAVE_SETTINGS
' Assistant
System.PrivateProfileString("", strREG_SETTINGS_BASE_KEY, strREG_ASSISTANT_TIME_STAMP) = Format$(Now, "General Date")
StoreValPref strREG_ASSISTANT_HELP, iLocalState
' Page 1
StoreValPref "iCalendarStyle", iCalendarStyle
' Page 2
StoreValPref "optPortrait", formWizard.optPortrait.Value
StoreValPref "optPictureYes", formWizard.optPictureYes.Value
' Page 3
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsSaved = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
End Sub
Public Sub RestoreDialogValues(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
StatusBar = strRST_SETTINGS
System.Cursor = wdCursorWait
' Page 1
iCalendarStyle = IRestorePref("iCalendarStyle", 0)
Select Case iCalendarStyle
Case wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
Case wzBANNER
formWizard.optBanner.Value = True
formWizard.shpShadowBanner.Visible = True
Case wzJAZZY
formWizard.optJazzy.Value = True
formWizard.shpShadowJazzy.Visible = True
Case Else
iCalendarStyle = wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
End Select
' Page 2
If FRestorePref("optPortrait", False) Then
formWizard.optPortrait.Value = True
formWizard.shpPortraitShadow.Visible = True
formWizard.shpLandscapeShadow.Visible = False
Else
formWizard.optLandscape.Value = True
formWizard.shpPortraitShadow.Visible = False
formWizard.shpLandscapeShadow.Visible = True
End If
formWizard.optPictureYes.Value = FRestorePref("optPictureYes", False)
' Page 3
formWizard.cboMonthStart.ListIndex = Month(Date) - 1
formWizard.cboMonthEnd.ListIndex = Month(Date) - 1
formWizard.txtYearStart = Year(Date)
formWizard.txtYearEnd = Year(Date)
fCheckValidity = False
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsRestored = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
Exit Sub
End Sub ' RestoreDialogValues
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub CreateNewDoc(fDummy As Boolean)
Dim iMonthCurr As Integer
Dim iYearCurr As Integer
Dim lYearMonthCurr As Long
Dim lYearMonthEnd As Long
Dim iDaysCnt As Integer
Dim iDaysInMonth As Integer
Dim iCnt As Integer
Dim strAutoTextName As String
Dim objTableDays As Table
Dim iRow As Integer
Dim iCol As Integer
Dim ocboMonthStart As ComboBox
Dim ocboMonthEnd As ComboBox
Dim otxtYearStart As TextBox
Dim otxtYearEnd As TextBox
Dim strJazzyDayNames As String
Dim objFps As PageSetup
Dim objRng As Range
Dim sShortMargin As Single
Dim sLongMargin As Single
Dim strCaptionTxt As String
Dim iOrientation As Integer
Dim iNoPicture As Integer
Dim i As Integer
Dim strDays As String
On Error GoTo CreateNewDoc_Error
System.Cursor = wdCursorWait
Set ocboMonthStart = formWizard.cboMonthStart
Set ocboMonthEnd = formWizard.cboMonthEnd
Set otxtYearStart = formWizard.txtYearStart
Set otxtYearEnd = formWizard.txtYearEnd
With Application
.ScreenUpdating = False
.StatusBar = strStatusIntro
End With
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
If (formWizard.optPortrait) Then
iOrientation = iORTN_PORTRAIT
Else
iOrientation = iORTN_LANDSCAPE
End If
iNoPicture = Abs(formWizard.optPictureNo.Value)
'the margins have to be changed if papersize was changed in Common
If (fChangeToA4 Or fChangeToLetter) Then
Set objFps = ActiveDocument.PageSetup
If iOrientation = iORTN_LANDSCAPE Then
objFps.Orientation = wdOrientLandscape 'setting paper size in common
'resets orientation to Portrait
If fChangeToA4 Then
sShortMargin = sA4_SHORT_MARGIN
sLongMargin = sA4_LONG_MARGIN
Else
sShortMargin = sLETTER_SHORT_MARGIN
sLongMargin = sLETTER_LONG_MARGIN
End If
Else
If fChangeToA4 Then
sShortMargin = sA4_LONG_MARGIN
sLongMargin = sA4_SHORT_MARGIN
Else
sShortMargin = sLETTER_LONG_MARGIN
sLongMargin = sLETTER_SHORT_MARGIN
End If
End If
With objFps
.TopMargin = sShortMargin
.BottomMargin = sShortMargin
.LeftMargin = sLongMargin
.RightMargin = sLongMargin
End With
End If
strAutoTextName = StrBuildAutoTextName(True)
objWizTemplate.AutoTextEntries(strAutoTextName).Insert objActiveRange, True
If iCalendarStyle <> wzJAZZY Then
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDays).Range
Else
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDayNames).Range
End If
strJazzyDayNames = ""
For iCnt = iWeekStartDay To 6
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
For iCnt = 0 To (iWeekStartDay - 1)
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
'Strip trailing Tab
strJazzyDayNames = Left$(strJazzyDayNames, Len(strJazzyDayNames) - 1)
objActiveRange.Text = strJazzyDayNames
If iCalendarStyle <> wzJAZZY Then
If (iCalendarStyle = wzBANNER) And (iOrientation = iORTN_LANDSCAPE) And (iNoPicture = 0) Then
objActiveRange.Style = strSTY_BANNER_HDG3
Else
objActiveRange.Style = rgstrMonthNamesStyle(iCalendarStyle)
End If
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 1, 7
End If
Set objActiveRange = ActiveDocument.Content
objActiveRange.Copy
iMonthCurr = CInt(ocboMonthStart.ListIndex) + 1
iYearCurr = CInt(otxtYearStart.Text)
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
lYearMonthEnd = (CLng(otxtYearEnd.Text) * 100) + (CLng(ocboMonthEnd.ListIndex) + 1)
'Create each month of the calendar
Do Until lYearMonthCurr > lYearMonthEnd
Application.StatusBar = strStatusPart1 & rgstrMonthName(iMonthCurr - 1) & strStatusPart2 & CStr(iYearCurr) & strStatusPart3
'Set month
If iCalendarStyle = wzJAZZY Then
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = CStr(iMonthCurr)
Else
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = rgstrMonthName(iMonthCurr - 1)
End If
'Set year
ActiveDocument.Bookmarks(strBkMkYear).Range.Text = CStr(iYearCurr)
'Determine number of days in month
If iMonthCurr = 2 Then
iDaysInMonth = DateSerial(iYearCurr, 3, 1) - DateSerial(iYearCurr, 2, 1)
Else
iDaysInMonth = rgiDaysInMonth(iMonthCurr - 1)
End If
'Set Column of First Day Of Month by using Weekday function. The 8th
'is used (to start with) instead of the 1st to allow for offsetting (via
'iWeekStartDay) for localization since the 8th will always fall on the
'same day (of the week) as the 1st.
iCol = WeekDay(DateSerial(iYearCurr, iMonthCurr, 8 - iWeekStartDay))
ActiveDocument.Bookmarks(strBkMkDays).Select
If iCalendarStyle <> wzJAZZY Then _
Selection.MoveDown wdLine 'the bookmark is now in the first cell of the table
strDays = ""
For i = 1 To iCol - 1
strDays = strDays & vbTab
Next i
strDays = strDays & str1_TO_28
For i = 29 To iDaysInMonth
strDays = strDays & vbTab & CStr(i)
Next i
'to get a 6 * 7 table always
For i = iDaysInMonth + iCol - 1 To 41
strDays = strDays & vbTab
Next i
Set objActiveRange = Selection.Range
objActiveRange.Text = strDays
objActiveRange.Style = rgstrDaysStyle(iCalendarStyle) & iOrientation & iNoPicture
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 6, 7
Selection.Cells.Height = rgsDaysHeight(iCalendarStyle, iOrientation, iNoPicture)
Selection.Tables(1).Rows(1).Height = rgsMonthNamesHeight(iCalendarStyle, iOrientation, iNoPicture)
'========================================================
' Mn.Sept.01.2014; 08h21
' TABLE GRIDLINES CODE: Automatically creates printable gridlines in the table.
With Selection.Tables(1).Borders
.InsideLineStyle = wdLineStyleSingle
.InsideLineWidth = wdLineWidth100pt
.InsideColorIndex = wdAuto
.OutsideLineStyle = wdLineStyleSingle
.OutsideLineWidth = wdLineWidth100pt
End With
'========================================================
ActiveDocument.Bookmarks(strBkMkDays).Delete
'Advance the current month
If iMonthCurr = 12 Then
iMonthCurr = 1
iYearCurr = iYearCurr + 1
Else
iMonthCurr = iMonthCurr + 1
End If
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
If lYearMonthCurr <= lYearMonthEnd Then
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
'Insert Page Break
objActiveRange.InsertBreak wdPageBreak
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
objActiveRange.Paste
End If
Loop
Application.StatusBar = ""
strCaptionTxt = ""
'Set Application caption
strCaptionTxt = " - " & strAppCaptionPart1 & strAppCaptionPart1b & ocboMonthStart.Text & strAppCaptionPart2 & otxtYearStart.Text & strAppCaptionPart3 & ocboMonthEnd.Text & strAppCaptionPart4 & otxtYearEnd.Text
ActiveDocument.UndoClear
With ActiveWindow
.Caption = .Caption & strCaptionTxt
With .View
.TableGridlines = False
.ShowDrawings = True
End With
End With
'Position cursor at the top
Selection.HomeKey wdStory
CreateNewDoc_Exit:
Exit Sub
CreateNewDoc_Error:
ReportError Err
GoTo CreateNewDoc_Exit
End Sub ' CreateNewDoc
Public Sub InitCallBack(fDummy As Boolean)
Dim i As Integer
Dim objCallBackLabels As BalloonLabels
On Error GoTo ErrorCallBack
If Not (fBlnInitialized) Then
Set objPostWizBln = Assistant.NewBalloon
fBlnInitialized = True
With objPostWizBln
.Heading = strCallBackHeading
.Mode = msoModeModeless
.Button = msoButtonSetCancel
.BalloonType = msoBalloonTypeButtons
.Callback = "Calendar.fnCallBack"
End With
Set objCallBackLabels = objPostWizBln.Labels
objCallBackLabels.Count = iCALL_BACK_COUNT
For i = 1 To iCALL_BACK_COUNT
objCallBackLabels.Item(i).Text = rgstrCallBackMsg(i - 1)
Next i
End If
objPostWizBln.Show
If (Assistant.BalloonError) Then GoTo ErrorCallBack
fPostWizBlnOpen = True
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "1"
Exit Sub
ErrorCallBack:
DisplayErrorMsg strERR_INIT_CALL_BACK
fPostWizBlnOpen = False
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "0"
End Sub
Public Function fnCallBack(objBln As Balloon, iBtn As Integer, lPrivate As Long)
On Error GoTo ErrorCallBack
Select Case iBtn
Case Is < 1 'Exit
objBln.Close
fPostWizBlnOpen = False
ActiveDocument.Variables(strPOST_WIZ_BLN).Value = "0"
RestoreAssistant (True)
Case 1 'Remove existing picture
DisplayTip rgstrCallBackTip(0)
Case 2 'Enter information into calendar
DisplayTip rgstrCallBackTip(1)
Case 3 ' Get help
Assistant.Help
End Select
Exit Function
ErrorCallBack:
DisplayErrorMsg Err.Description
End Function
Private Function StrBuildAutoTextName(fDummy As Boolean) As String
Dim strATName As String
On Error GoTo BuildAutoTextName_Error
'Select base AutoText Name NOTE: DO NOT LOCALIZE
Select Case iCalendarStyle
Case wzBOXES
strATName = "Boxes"
Case wzBANNER
strATName = "Banner"
Case wzJAZZY
strATName = "Jazzy"
End Select
strATName = strATName & CStr(Abs(formWizard.optLandscape.Value))
strATName = strATName & CStr(Abs(formWizard.optPictureNo.Value))
StrBuildAutoTextName = strATName
BuildAutoTextName_Exit:
Exit Function
BuildAutoTextName_Error:
StrBuildAutoTextName = ""
Resume BuildAutoTextName_Exit
End Function
'displays a tip during post-wizard options
'assumes that Assistant is present since it is called from post-wizard balloon
Private Sub DisplayTip(strTip As String)
Dim objBlnTip As Balloon
On Error GoTo FatalError
Set objBlnTip = Assistant.NewBalloon
With objBlnTip
.Mode = msoModeModal
.Heading = strWizName
.Text = strTip
.Button = msoButtonSetOK
End With
objBlnTip.Show
If Assistant.BalloonError <> msoBalloonErrorNone Then GoTo FatalError
Exit Sub
FatalError:
Err.Clear
End Sub
The above is from the module labelled "Calendar".  I don't believe anything was altered in the module labelled "Common", but please let me know that I should post it.
To recap, in this wizard file, the first day of the week is set for Monday.  So the Saturday and Sunday columns always fall as the last 2 columns in the calendar table (Sunday as first day has the 1st and last column as the ones that would need shading).
How can that syntax be added to shade the last 2 columns in the Monday calendar wizard, and the 1st and last column for the Sunday calendar wizard and hopefully shading just those particular cells in either with numbers in them?
Thank you!  Very much appreciated. 

Thanks, Doug!  Works beautifully.  I tried them again this morning, really incredible!
I'm going to keep the Monday and Sunday wizard files as separate files because I realized that I don't have the skills (or the time) to try to figure out how to modify it so the user is requested the starting day.  It'll be beyond my meager skills,
I'm sure, especially since there are all those dialogue boxes to contend with at the wizard's start.  I was forgetting about those.  So leaving these as 2 separate files where one chooses the starting day as per the title, the Monday one for Monday
and the other, the Sunday one, for a Sunday start day.
However, the only difference between them at this point is that one has a "0" for Sunday and the other a "1" for Monday, at the appropriate spots in the code.  being the starting week day and the other a "1" for Monday. 
That's it.  They're beautifully the same in the rest of the code.  And a further benefit is that only one module was touched at all for all of this, the Calendar module (leaving the one labelled "Common" untouched.
So anyone with a calendar wizard file can just change the piece of code below (begging the group's indulgence, if I may, in posting the modified code (??):
' WORD 97 WIZARD
' Calendar Wizard Specific Code
Option Explicit
' CONSTANT DECLARATIONS
'=============================== LOCALIZATION BLOCK ===============================
' Localization Note: iWeekStartDay is the starting day of the week (Sun = 0, Mon = 1, ...Sat = 6)
Public Const iWeekStartDay As Integer = 1
' Banter strings
Public Const strWarnYearReq As String = "Both starting and ending years are required."
Public Const strWarnMinExceeded As String = "The year can not be before 1900."
Public Const strWarnMaxExceeded As String = "The year can not be after 4095."
Public Const strWarnRangeExceeded As String = "The calendar is limited to 120 months (10 years)."
Public Const strAppCaptionPart1 As String = "Calendar: "
Public Const strAppCaptionPart1b As String = ""
Public Const strAppCaptionPart2 As String = ", "
Public Const strAppCaptionPart3 As String = " to "
Public Const strAppCaptionPart4 As String = ", "
' Status messages
Public Const strStatusIntro As String = "Creating Calendar..."
Public Const strStatusPart1 As String = "Creating "
Public Const strStatusPart2 As String = ", "
Public Const strStatusPart3 As String = "..."
' Assistant
Public Const strCallBackHeading As String = "Do more with the calendar?"
'Margins for A4 size (if wizard changes pagesize to A4)
Public Const sA4_SHORT_MARGIN As Single = 28.8
Public Const sA4_LONG_MARGIN As Single = 57.6
'Margins for Letter size (if wizard changes pagesize to Letter) in pts
Public Const sLETTER_SHORT_MARGIN As Single = 36
Public Const sLETTER_LONG_MARGIN As Single = 36
'========== END LOCALIZATION BLOCK - DO NOT MAKE CHANGES BELOW THIS LINE ==========
Public Const iYearMin As Integer = 1900
Public Const iYearMax As Integer = 4095
' Bookmark Names - DO NOT LOCALIZE
' Note: No spaces allowed in bookmark names
Public Const strBkMkMonth As String = "Month"
Public Const strBkMkDays As String = "Days"
Public Const strBkMkDayNames As String = "DayNames"
Public Const strBkMkYear As String = "Year"
' Calendar Style Names and Constants
Public Const wzBOXES As Integer = 0
Public Const wzBANNER As Integer = 1
Public Const wzJAZZY As Integer = 2
' Form Control
Public Const wzPAGE_START As Integer = 0
Public Const wzPAGE_STYLE As Integer = 1
Public Const wzPAGE_DIRECTION As Integer = 2
Public Const wzPAGE_MONTHS As Integer = 3
Public Const wzPAGE_FINISH As Integer = 4
'orientation
Public Const iORTN_PORTRAIT As Integer = 0
Public Const iORTN_LANDSCAPE As Integer = 1
' Assistant
Public Const iMAX_PANEL As Integer = 4 ' Number of last panel in MultiPage (First=0)
Public Const iCALL_BACK_COUNT As Integer = 3 ' Number of items in CallBackBalloon (First=1)
'postwizard balloon document variable
Public Const strPOST_WIZ_BLN As String = "Calendar post wizard balloon"
' VARIABLE DECLARATIONS
' General
Public rgstrMonthName(11) As String
Public rgstrDayName(6) As String
Public rgiDaysInMonth(11) As String
Public fDateError As Boolean
Public fCheckValidity As Boolean 'if set then the dates are checked for validity
'variables used in doc. creation
Public str1_TO_28 As String
Public rgsDaysHeight(2, 1, 1) As Single
Public rgsMonthNamesHeight(2, 1, 1) As Single
Public rgstrDaysStyle(2) As String
Public rgstrMonthNamesStyle(2) As String
Public strSTY_BANNER_HDG3 As String
' Assistant
Public rgstrAssistantMsg(iMAX_PANEL + 1) As String
Public rgstrCallBackMsg(iCALL_BACK_COUNT) As String
Public rgstrCallBackTip(iCALL_BACK_COUNT) As String
' Page 1
Public iCalendarStyle As Integer
Public iSavedStyle As Integer
' Page 2
' Page 3
' Page 4
Public Sub InitWizardName(fDummy As Boolean)
strWizName = "Calendar Wizard"
strWizLongName = strWizName
strWizShortName = "Calendar"
End Sub
Public Sub InitWizardStrings(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
'=============================== LOCALIZATION BLOCK ===============================
' Note: this list is indexed 0 - iMAX_PANEL
rgstrAssistantMsg(0) = "The Calendar Wizard helps you create a monthly calendar that you can customize with pictures and events. If you want to track and be reminded of events, you should probably use Microsoft Outlook, Microsoft Schedule+, or Microsoft Exchange."
rgstrAssistantMsg(1) = "Select the look you want for your calendar. The Jazzy style uses the Algerian font. If it is not installed on your system, copy alger.ttf from the Valupack folder on the Microsoft Office CD to your hard drive."
rgstrAssistantMsg(2) = "If you leave room for a picture, Word will insert a placeholder picture that you can replace with any picture you want."
rgstrAssistantMsg(3) = "Your calendar can start on any month, and you can make your calendar shorter than or longer than 12 months. Each month will appear on a different page."
rgstrAssistantMsg(4) = "To change any settings, click Back."
' Note: change constant iCALL_BACK_COUNT if number of items in list changes
rgstrCallBackMsg(0) = "Add, remove, or replace a picture"
rgstrCallBackMsg(1) = "Enter information into the calendar"
rgstrCallBackMsg(2) = "Get Help on Something Else..."
rgstrCallBackTip(0) = "To remove a picture, click on it and then press Delete. To add a picture, click where you want to insert the picture, point to Picture on the Insert menu, and then click From File."
rgstrCallBackTip(1) = "To enter information, click where you want to insert the text and start typing. To move between different dates in the calendar, press Tab to move forward or press Shift+Tab to move to the previous date."
'Load Month Name array
rgstrMonthName(0) = "January"
rgstrMonthName(1) = "February"
rgstrMonthName(2) = "March"
rgstrMonthName(3) = "April"
rgstrMonthName(4) = "May"
rgstrMonthName(5) = "June"
rgstrMonthName(6) = "July"
rgstrMonthName(7) = "August"
rgstrMonthName(8) = "September"
rgstrMonthName(9) = "October"
rgstrMonthName(10) = "November"
rgstrMonthName(11) = "December"
'Load Day Name array LOCALIZATION NOTE: DO NOT CHANGE THE ORDER IN WHICH THESE APPEAR!
' TO CHANGE THE WEEK START DAY, CHANGE THE CONSTANT iWeekStartDay
rgstrDayName(0) = "Sun"
rgstrDayName(1) = "Mon"
rgstrDayName(2) = "Tue"
rgstrDayName(3) = "Wed"
rgstrDayName(4) = "Thu"
rgstrDayName(5) = "Fri"
rgstrDayName(6) = "Sat"
'Load Days In Month array
rgiDaysInMonth(0) = 31
rgiDaysInMonth(1) = 28 'Will not be used - must be calculated for leap year accuracy
rgiDaysInMonth(2) = 31
rgiDaysInMonth(3) = 30
rgiDaysInMonth(4) = 31
rgiDaysInMonth(5) = 30
rgiDaysInMonth(6) = 31
rgiDaysInMonth(7) = 31
rgiDaysInMonth(8) = 30
rgiDaysInMonth(9) = 31
rgiDaysInMonth(10) = 30
rgiDaysInMonth(11) = 31
rgstrDaysStyle(wzBOXES) = "Boxes"
rgstrDaysStyle(wzBANNER) = "Banner"
rgstrDaysStyle(wzJAZZY) = "Jazzy"
rgstrMonthNamesStyle(wzBOXES) = "Boxes Heading2"
rgstrMonthNamesStyle(wzBANNER) = "Banner Heading2"
'we dont set the style for month names in Jazzy style
'the Banner style landscape calendar with picture uses Banner Heading3 style for month names
strSTY_BANNER_HDG3 = "Banner Heading3"
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 0) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_PORTRAIT, 1) = 55
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 36
rgsMonthNamesHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 36
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 0) = 56
rgsDaysHeight(wzBOXES, iORTN_PORTRAIT, 1) = 102
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 0) = 72
rgsDaysHeight(wzBOXES, iORTN_LANDSCAPE, 1) = 71
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 0) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_PORTRAIT, 1) = 60
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 55
rgsMonthNamesHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 51
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 0) = 64
rgsDaysHeight(wzBANNER, iORTN_PORTRAIT, 1) = 110
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 0) = 81
rgsDaysHeight(wzBANNER, iORTN_LANDSCAPE, 1) = 81
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 73
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 62
rgsMonthNamesHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 59
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 0) = 40.5
rgsDaysHeight(wzJAZZY, iORTN_PORTRAIT, 1) = 81.8
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 0) = 58.2
rgsDaysHeight(wzJAZZY, iORTN_LANDSCAPE, 1) = 57.5
str1_TO_28 = ""
For i = 1 To 28
str1_TO_28 = str1_TO_28 & CStr(i) & vbTab
Next i
'strip off last tab
str1_TO_28 = Left$(str1_TO_28, Len(str1_TO_28) - 1)
' Location in registry DO NOT LOCALIZE
strRegSettingsKey = strREG_SETTINGS_BASE_KEY & "Calendar Wizard"
Exit Sub
FatalError:
ReportError Err
End Sub ' InitWizardStrings
Public Sub InitWizard(fDummy As Boolean)
' Global Vars
fWizardCallBack = False
fDateError = False
iCurrentPanel = 0
' Initialize strings
InitWizardStrings (True)
' Create a new instance of the form
Set formWizard = New formWizDlg
If formWizard Is Nothing Then GoTo FatalError
formWizard.lblWizName1.Caption = " " & strWizLongName & " "
Exit Sub
FatalError:
DisplayErrorMsg strERR_INIT_FORM
ReportError Err
End Sub
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub SaveDialogValues(fDummy As Boolean)
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
System.Cursor = wdCursorWait
StatusBar = strSAVE_SETTINGS
' Assistant
System.PrivateProfileString("", strREG_SETTINGS_BASE_KEY, strREG_ASSISTANT_TIME_STAMP) = Format$(Now, "General Date")
StoreValPref strREG_ASSISTANT_HELP, iLocalState
' Page 1
StoreValPref "iCalendarStyle", iCalendarStyle
' Page 2
StoreValPref "optPortrait", formWizard.optPortrait.Value
StoreValPref "optPictureYes", formWizard.optPictureYes.Value
' Page 3
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsSaved = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
End Sub
Public Sub RestoreDialogValues(fDummy As Boolean)
Dim i As Integer
On Error GoTo FatalError
' Display status
Application.ScreenUpdating = False
StatusBar = strRST_SETTINGS
System.Cursor = wdCursorWait
' Page 1
iCalendarStyle = IRestorePref("iCalendarStyle", 0)
Select Case iCalendarStyle
Case wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
Case wzBANNER
formWizard.optBanner.Value = True
formWizard.shpShadowBanner.Visible = True
Case wzJAZZY
formWizard.optJazzy.Value = True
formWizard.shpShadowJazzy.Visible = True
Case Else
iCalendarStyle = wzBOXES
formWizard.optBoxes.Value = True
formWizard.shpShadowBoxes.Visible = True
End Select
' Page 2
If FRestorePref("optPortrait", False) Then
formWizard.optPortrait.Value = True
formWizard.shpPortraitShadow.Visible = True
formWizard.shpLandscapeShadow.Visible = False
Else
formWizard.optLandscape.Value = True
formWizard.shpPortraitShadow.Visible = False
formWizard.shpLandscapeShadow.Visible = True
End If
formWizard.optPictureYes.Value = FRestorePref("optPictureYes", False)
' Page 3
formWizard.cboMonthStart.ListIndex = Month(Date) - 1
formWizard.cboMonthEnd.ListIndex = Month(Date) - 1
formWizard.txtYearStart = Year(Date)
formWizard.txtYearEnd = Year(Date)
fCheckValidity = False
StatusBar = ""
System.Cursor = wdCursorNormal
fSettingsRestored = True
Application.ScreenUpdating = True
Exit Sub
FatalError:
ReportError Err
Exit Sub
End Sub ' RestoreDialogValues
' fDummy prevents sub from appearing in Word Tools/Macro list
Public Sub CreateNewDoc(fDummy As Boolean)
Dim iMonthCurr As Integer
Dim iYearCurr As Integer
Dim lYearMonthCurr As Long
Dim lYearMonthEnd As Long
Dim iDaysCnt As Integer
Dim iDaysInMonth As Integer
Dim iCnt As Integer
Dim strAutoTextName As String
Dim objTableDays As Table
Dim iRow As Integer
Dim iCol As Integer
Dim ocboMonthStart As ComboBox
Dim ocboMonthEnd As ComboBox
Dim otxtYearStart As TextBox
Dim otxtYearEnd As TextBox
Dim strJazzyDayNames As String
Dim objFps As PageSetup
Dim objRng As Range
Dim sShortMargin As Single
Dim sLongMargin As Single
Dim strCaptionTxt As String
Dim iOrientation As Integer
Dim iNoPicture As Integer
Dim i As Integer
Dim strDays As String
On Error GoTo CreateNewDoc_Error
System.Cursor = wdCursorWait
Set ocboMonthStart = formWizard.cboMonthStart
Set ocboMonthEnd = formWizard.cboMonthEnd
Set otxtYearStart = formWizard.txtYearStart
Set otxtYearEnd = formWizard.txtYearEnd
With Application
.ScreenUpdating = False
.StatusBar = strStatusIntro
End With
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
If (formWizard.optPortrait) Then
iOrientation = iORTN_PORTRAIT
Else
iOrientation = iORTN_LANDSCAPE
End If
iNoPicture = Abs(formWizard.optPictureNo.Value)
'the margins have to be changed if papersize was changed in Common
If (fChangeToA4 Or fChangeToLetter) Then
Set objFps = ActiveDocument.PageSetup
If iOrientation = iORTN_LANDSCAPE Then
objFps.Orientation = wdOrientLandscape 'setting paper size in common
'resets orientation to Portrait
If fChangeToA4 Then
sShortMargin = sA4_SHORT_MARGIN
sLongMargin = sA4_LONG_MARGIN
Else
sShortMargin = sLETTER_SHORT_MARGIN
sLongMargin = sLETTER_LONG_MARGIN
End If
Else
If fChangeToA4 Then
sShortMargin = sA4_LONG_MARGIN
sLongMargin = sA4_SHORT_MARGIN
Else
sShortMargin = sLETTER_LONG_MARGIN
sLongMargin = sLETTER_SHORT_MARGIN
End If
End If
With objFps
.TopMargin = sShortMargin
.BottomMargin = sShortMargin
.LeftMargin = sLongMargin
.RightMargin = sLongMargin
End With
End If
strAutoTextName = StrBuildAutoTextName(True)
objWizTemplate.AutoTextEntries(strAutoTextName).Insert objActiveRange, True
If iCalendarStyle <> wzJAZZY Then
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDays).Range
Else
Set objActiveRange = ActiveDocument.Bookmarks(strBkMkDayNames).Range
End If
strJazzyDayNames = ""
For iCnt = iWeekStartDay To 6
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
For iCnt = 0 To (iWeekStartDay - 1)
strJazzyDayNames = strJazzyDayNames & rgstrDayName(iCnt) & vbTab
Next
'Strip trailing Tab
strJazzyDayNames = Left$(strJazzyDayNames, Len(strJazzyDayNames) - 1)
objActiveRange.Text = strJazzyDayNames
If iCalendarStyle <> wzJAZZY Then
If (iCalendarStyle = wzBANNER) And (iOrientation = iORTN_LANDSCAPE) And (iNoPicture = 0) Then
objActiveRange.Style = strSTY_BANNER_HDG3
Else
objActiveRange.Style = rgstrMonthNamesStyle(iCalendarStyle)
End If
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 1, 7
End If
Set objActiveRange = ActiveDocument.Content
objActiveRange.Copy
iMonthCurr = CInt(ocboMonthStart.ListIndex) + 1
iYearCurr = CInt(otxtYearStart.Text)
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
lYearMonthEnd = (CLng(otxtYearEnd.Text) * 100) + (CLng(ocboMonthEnd.ListIndex) + 1)
'Create each month of the calendar
Do Until lYearMonthCurr > lYearMonthEnd
Application.StatusBar = strStatusPart1 & rgstrMonthName(iMonthCurr - 1) & strStatusPart2 & CStr(iYearCurr) & strStatusPart3
'Set month
If iCalendarStyle = wzJAZZY Then
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = CStr(iMonthCurr)
Else
ActiveDocument.Bookmarks(strBkMkMonth).Range.Text = rgstrMonthName(iMonthCurr - 1)
End If
'Set year
ActiveDocument.Bookmarks(strBkMkYear).Range.Text = CStr(iYearCurr)
'Determine number of days in month
If iMonthCurr = 2 Then
iDaysInMonth = DateSerial(iYearCurr, 3, 1) - DateSerial(iYearCurr, 2, 1)
Else
iDaysInMonth = rgiDaysInMonth(iMonthCurr - 1)
End If
'Set Column of First Day Of Month by using Weekday function. The 8th
'is used (to start with) instead of the 1st to allow for offsetting (via
'iWeekStartDay) for localization since the 8th will always fall on the
'same day (of the week) as the 1st.
iCol = WeekDay(DateSerial(iYearCurr, iMonthCurr, 8 - iWeekStartDay))
ActiveDocument.Bookmarks(strBkMkDays).Select
If iCalendarStyle <> wzJAZZY Then _
Selection.MoveDown wdLine 'the bookmark is now in the first cell of the table
strDays = ""
For i = 1 To iCol - 1
strDays = strDays & vbTab
Next i
strDays = strDays & str1_TO_28
For i = 29 To iDaysInMonth
strDays = strDays & vbTab & CStr(i)
Next i
'to get a 6 * 7 table always
For i = iDaysInMonth + iCol - 1 To 41
strDays = strDays & vbTab
Next i
Set objActiveRange = Selection.Range
objActiveRange.Text = strDays
objActiveRange.Style = rgstrDaysStyle(iCalendarStyle) & iOrientation & iNoPicture
objActiveRange.Select
Selection.ConvertToTable wdSeparateByTabs, 6, 7
Selection.Cells.Height = rgsDaysHeight(iCalendarStyle, iOrientation, iNoPicture)
Selection.Tables(1).Rows(1).Height = rgsMonthNamesHeight(iCalendarStyle, iOrientation, iNoPicture)
'================================================================================================================================
' Tu.Mar.11.2015; 17h56 - MVPEdits/MyEdits
' SATURDAY and SUNDAY cells get shaded in the table (no matter where they fall).
' Doug Robbins - Word MVP; https://social.msdn.microsoft.com/Forums/office/en-US/6ab55be0-adc0-4e37-9565-8cdff089d20a/shading-certain-columns-depending-on-start-day-of-week?forum=worddev
Dim j As Long
With Selection.Tables(1)
If iWeekStartDay = 1 Then
For i = 6 To 7
With .Columns(i)
' For j = 1 To .Cells.Count ' 1 = Cells with SAT and SUN text are shaded
For j = 2 To .Cells.Count ' 2 = Cells with SAT and SUN text are _ NOT_ shaded
With .Cells(j).Range
If Len(.Text) > 2 Then
.Shading.BackgroundPatternColor = wdColorGray20 'wdColorGray_ _ _ (the number following gives the shade of gray, i.e., wdColorGray20 vs. wdColorGray50)
End If
End With
Next j
End With
Next i
Else
For i = 1 To 7 Step 6
With .Columns(i)
' For j = 1 To .Cells.Count ' 1 = Cells with SAT and SUN text are shaded
For j = 2 To .Cells.Count ' 2 = Cells with SAT and SUN text are _ NOT_ shaded
With .Cells(j).Range
If Len(.Text) > 2 Then
.Shading.BackgroundPatternColor = wdColorGray20 'wdColorGray_ _ _ (the number following gives the shade of gray, i.e., wdColorGray20 vs. wdColorGray50)
End If
End With
Next j
End With
Next i
End If
End With
'================================================================================================================================
'================================================================================================================================
' Mn.Sept.01.2014; 08h21 - MVPEdits/MyEdits
' TABLE GRIDLINES CODE: Automatically creates printable gridlines in the table.
With Selection.Tables(1).Borders
.InsideLineStyle = wdLineStyleSingle
.InsideLineWidth = wdLineWidth100pt
.InsideColorIndex = wdAuto
.OutsideLineStyle = wdLineStyleSingle
.OutsideLineWidth = wdLineWidth100pt
End With
'================================================================================================================================
ActiveDocument.Bookmarks(strBkMkDays).Delete
'Advance the current month
If iMonthCurr = 12 Then
iMonthCurr = 1
iYearCurr = iYearCurr + 1
Else
iMonthCurr = iMonthCurr + 1
End If
lYearMonthCurr = (CLng(iYearCurr) * 100) + CLng(iMonthCurr)
If lYearMonthCurr <= lYearMonthEnd Then
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
'Insert Page Break
objActiveRange.InsertBreak wdPageBreak
Set objActiveRange = ActiveDocument.Content
objActiveRange.Collapse wdCollapseEnd
objActiveRange.Paste
End If
Loop
Application.StatusBar = ""
strCaptionTxt = ""
'Set Application caption
strCaptionTxt = " - " & strAppCaptionPart1 & strAppCaptionPart1b & ocboMonthStart.Text & strAppCaptionPart2 & otxtYearStart.Text & strAppCaptionPart3 & ocboMonthEnd.Text & strAppCaptionPart4 & otxtYearEnd.Text
ActiveDocument.UndoClear
With ActiveWindow
.Caption = .Caption & strCaptionTxt
With .View
.TableGridlines = False
.ShowDrawings = True
End With
End With
'Position cursor at the top
Selection.HomeKey wdStory
CreateNewDoc_Exit:
Exit Sub
CreateNewDoc_Error:
ReportError Err
GoTo CreateNewDoc_Exit
End Sub ' CreateNewDoc
Public Sub InitCallBack(fDummy As Boolean)
Dim i As Integer
Dim objCallBackLabels As BalloonLabels
On Error GoTo ErrorCallBack
If Not (fBlnInitialized) Then
Set objPostWizBln = Assistant.NewBalloon
fBlnInitialized = True
With objPostWizBln
.Heading = strCallBackHeading
.Mode = msoModeModeless
.Button = msoButtonSetCancel
.BalloonType = msoBalloonTypeButtons
.Callback = "Calendar.fnCallBack"
End With
Set objCallBackLabels = objPostWizBln.Labels
objCallBackLabels.Count = iCALL_BACK_COUNT
For i = 1 To iCALL_BACK_COUNT
objCallBackLabels.Item(i).Text = rgstrCallBackMsg(i - 1)
Next i
End If
objPostWizBln.Show
If (Assistant.BalloonError) Then GoTo ErrorCallBack
fPostWizBlnOpen = True
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "1"
Exit Sub
ErrorCallBack:
DisplayErrorMsg strERR_INIT_CALL_BACK
fPostWizBlnOpen = False
Set objDocBln = ActiveDocument
Set clsBln.app = Application
ActiveDocument.Variables.Add strPOST_WIZ_BLN, "0"
End Sub
Public Function fnCallBack(objBln As Balloon, iBtn As Integer, lPrivate As Long)
On Error GoTo ErrorCallBack
Select Case iBtn
Case Is < 1 'Exit
objBln.Close
fPostWizBlnOpen = False
ActiveDocument.Variables(strPOST_WIZ_BLN).Value = "0"
RestoreAssistant (True)
Case 1 'Remove existing picture
DisplayTip rgstrCallBackTip(0)
Case 2 'Enter information into calendar
DisplayTip rgstrCallBackTip(1)
Case 3 ' Get help
Assistant.Help
End Select
Exit Function
ErrorCallBack:
DisplayErrorMsg Err.Description
End Function
Private Function StrBuildAutoTextName(fDummy As Boolean) As String
Dim strATName As String
On Error GoTo BuildAutoTextName_Error
'Select base AutoText Name NOTE: DO NOT LOCALIZE
Select Case iCalendarStyle
Case wzBOXES
strATName = "Boxes"
Case wzBANNER
strATName = "Banner"
Case wzJAZZY
strATName = "Jazzy"
End Select
strATName = strATName & CStr(Abs(formWizard.optLandscape.Value))
strATName = strATName & CStr(Abs(formWizard.optPictureNo.Value))
StrBuildAutoTextName = strATName
BuildAutoTextName_Exit:
Exit Function
BuildAutoTextName_Error:
StrBuildAutoTextName = ""
Resume BuildAutoTextName_Exit
End Function
'displays a tip during post-wizard options
'assumes that Assistant is present since it is called from post-wizard balloon
Private Sub DisplayTip(strTip As String)
Dim objBlnTip As Balloon
On Error GoTo FatalError
Set objBlnTip = Assistant.NewBalloon
With objBlnTip
.Mode = msoModeModal
.Heading = strWizName
.Text = strTip
.Button = msoButtonSetOK
End With
objBlnTip.Show
If Assistant.BalloonError <> msoBalloonErrorNone Then GoTo FatalError
Exit Sub
FatalError:
Err.Clear
End Sub
Thank you once again for all your help!!  Very much appreciated.  :D

Similar Messages

  • Calender: Setting Start Day of Week

    The calender on my Touch in the monthly view starts the week on a Monday, how do I change it to start on Sunday?
    David

    You can change the Locale of your application into your faces-config.xml file.
    Here an example for FRENCH Locale:
    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
    <application>
    <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
    <locale-config>
    <default-locale>fr</default-locale>
    </locale-config>
    <resource-bundle>
    </application>
    </faces-config>
    Hope this help
    Jack

  • Function module for getting starting day of a week form current data

    Hi ,
    Is there any function module that gives starting day of week when we give a particular date
    eg: today date is 19-12-2007
    if i give this date as input i should get 16-12-2007 because this is starting day of this week .

    Hi,
    Use FM  GET_WEEK_INFO_BASED_ON_DATE
    You will get the first day of the week in export parameter MONDAY
    Lokesh

  • Is there a way to change the start day for the week?

    So I really like the "Insert Categories from the following" functionality of the Reorganize tool, and I fell in love with it's ability to break down by date automagically. I've encountered one problem with my use of it, though: I start my "work week" on Sunday, and it defaults to Monday as the first day of a week without any seeming way to change it to Sunday. Is there a way to do this?

    Hi Christopher,
    The WEEKDAY function allows specifying either Sunday or Monday as the first day of the week:
    WEEKDAY
    The WEEKDAY function returns a number that is the day of the week for a given date. WEEKDAY(date, first-day)
      date:  The date the function should use. date is a date/time value. The time portion is ignored by this function.
      first-day: An optional value that specifies how days are numbered.
    Sunday is 1 (1 or omitted):  Sunday is the first day (day 1) of the week and Saturday is day 7.
    Monday is 1 (2):  Monday is the first day (day 1) of the week and Sunday is day 7. Monday is 0 (3):  Monday is the first day (day 0) of the week and Sunday is day 6.
    But I think you are referring to the first day of the 'workweek', for which I do not see a means of defining a custom value.
    Since you want to 'insert categories', though, you could easily define your own, using WEEKDAY(date) or WEEKDAY(date,1), plus an IF statement to return the category label appropriate to the day. Here's one for a Sunday to Thursday work week. Dates are in column A, the formula is in whichever column you want as the Category column. For the example, I've placed it in column B.
    B2, and filled down: =IF(WEEKDAY(A)<6,"Work","Off")
    The top table shows the weekday numbers returned for each day of the week for each of the three permitted values for the optional second argument. The bottom table shows the results from the formula above, used to define a category label for each date:
    A10 was left blank intentionally, to determine if the lack of data resulted in an error. The Warning message, flagged by the blue 'warning' triangle, is "The formula uses a number in place of a date." The 'date' assigned to this numerical value of zero was a Friday, but I'm not certain when. Probably best to avoid extra rows with no date shown.
    Regards,
    Barry

  • Regarding Start day of the week

    Suppose in a program if User enters the start day of the week be 'Tuesday', then I have to get that day of the week as '1' and end the week with 'Monday' i.e the '7'. Is there any Query or NLS_Parameter setting?

    Hi,
    Since Tuesday is 1 day after the start of the ISO week,
    TRUNC (dt) - TRUNC (dt - 1, 'IW')will be an integer in the range 1-7, where 1 means dt was a Tuesday, and 7 means dt was a Monday.
    This does not depend on NLS settings.
    NLS_TERRITORY controls which day of the week
    TO_CHAR (dt, 'D')will be '1', but all the settings I know of make that Saturday, Sunday or Monday. I don't know if there's a value that makes it Tuesday.

  • Is it possible to disable datatips in columncharts for certain columns?

    Is it possible to disable datatips in columncharts for
    certain columns?

    Hello,
    apologizes for the misunderstanding.
    Regarding security, you might want to have a look at the forum and http://www.sdn.sap.com/irj/sdn/security.
    Back to the original matter, I can tell that modifying or extending the SAP GUI functionality on communication protocol level is quite challenging. The protocol is not published and a binary protocol.
    Depending what your intention is, you might want to have a look at [GuiXT|http://www.guixt.com/].
    Another approach is to write your own controls for SAP GUI, see [How To Extend SAP GUI for Java with Your Own Java Bean |http://www.sdn.sap.com/irj/sdn/sap-gui?rid=/library/uuid/20e0536f-eaf4-2a10-319d-eb68f8e6cee3] on the [SAP GUI family page|http://www.sdn.sap.com/irj/sdn/sap-gui#section16].
    Best regards
    Rolf-Martin

  • I am trying to find out if I can change a setting of the calendar in my iPhone.   When I view calendar, in month, I would like to view it with the starting day of the week being Monday, not Sunday.  Is it possible to make this change? SS

    I am trying to find out if I can change a setting of the calendar in my iPhone. 
    When I view calendar, in month, I would like to view it with the starting day of the week being Monday, not Sunday.  Is it possible to make this change?

    Hello SMEvans32
    You can use iCloud to share the Calendar, that way she will always be up to date on that particular section of your work calendar. If you want to use iCloud, I would recommend backing up so you have a safe copy of your data.
    iCloud: Calendar sharing overview
    http://support.apple.com/kb/PH2689
    iCloud Setup
    http://www.apple.com/icloud/setup/
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • Restict read only users to certain columns

    Hi guys ,
    I want to restrict read-only users to read only certain columns on the table.How do I go about restricting?

    Always include the following information when asking a question:
    <ul>
    <li>Full APEX version</li>
    <li>Full DB/version/edition/host OS</li>
    <li>Web server architecture (EPG, OHS or APEX listener/host OS)</li>
    <li>Browser(s) and version(s) used</li>
    <li>Theme</li>
    <li>Template(s)</li>
    <li>Region/item type(s)</li>
    </ul>
    935462 wrote:
    Hi guys ,
    I want to restrict read-only users to read only certain columns on the table.How do I go about restricting?Who are readonly users? How are they determined?
    What exactly are you talking about?
    Is it a report, If then which report Interactive or Classic?
    In either of them you can do conditional display of column using the same login
    Look at this for options http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldapp_rpt_att.htm#BCEBDIFA

  • Hide row values for certain column in GRR2

    Hi Experts,
    Looking for some help in report painter. I need to hide row values for certain columns in report painter. The requirement is I have 5 columns in the report, the 5 th column is the sum of col 1 to 4 and in my row i have a formula setup to sum of values for each column, what i would like to do is for column 1 thru 4 i didnt want to display the total values in row total but i wanted to dispaly value for column 5 in row total. I have been trying my best with putting formula, but couldnt succeed.
    Could somebody let me know is there an way to get this addressed.
    Thanks in advance
    Best Regards,
    gj

    How was it achieved ? Did you use sections for the columns for which rows needed to be hidden?
    I have a smiliar issue of hiding certain rows for few columns.

  • KMTL - How to add Column for OVER DUE DAYS in report

    Dear Concern,
          We are Microsoft Dynamics NAV 2013 users, We want a little change on Reminder Report (In report there is due date we inserted column for OVER DUE DAYS right side to Due Date column in we required Expression of which type of formula that
    shows us the Over Due Days for particular.
    Please every one confirm or suggest for this error.
    Thanks & regards,
    Laxman Sonar

    Hi Laxman Sonar,
    Per my understanding that you have an date field(Due Date) in the report and now you want to get the over due days based on this field and display at right of the date field in the report, right?
    I have tested on my local environment that we have two method to do this, one is to add the datediff functon in the query to get the overdue days and another method is to using expression in the report.
    Details information below for your reference:
    Method one:
    Modify the query as below to get the new field(OverDue Days):
    SELECT   DueDate, DATEDIFF(day, DueDate, GETDATE()) AS OverDueDays
    FROM      tableName
    Method Two:
    Add an calculated fields and then add the expression below to get the value for this field or just add expression directly in the new field:
    =Datediff("d",Fields!DueDate.Value,Today())
    If your problem still exists, please try to provide us some sample date and more details information about your requirements.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Format for certain columns in list view control

    I have a list view control and I would like to format the alignment for certain columns. I heard that the only way you can do this is by formatting the cells in excel. I tried this with no success. Can someone please give me step by step instructions on how to achieve this. I am currently allowing Xcelsius to handle my formatting for money. Is it possible to have Xcelsius handle the money formatting and have excel handle the alignment  formatting. I am open to whatever works at this point. Also I am using Xcelsius 2008 (Build Number 12,2,1,66).
    Much Thx

    Hi,
       In list view control you can format the entire row only, not a certain column.
       Go to property>Appearance>Text Tab>select Header>Format selected text->select the format.
      For width change: Property> Layout Tab>check custom column width the click the icon and enter width in pixel.
    Regards,
    Senthil K

  • How do you output a field column depending on another fields value?

    when selecting a field in a query, how do you output it on its own column depending on another fields value?
    For example
    Select
    a.gross_vol as Gas_vol when a.Object_code = "GAS"
    a.gross_vol as Wat_Vol when a.object_code = "water"

    how do you output it on its own column depending on another fields value?Scalar subquery maybe?:
    michaels>  select (select ename from emp where empno = 7788) scott_ename,
           (select ename from emp where empno = 7839) king_ename
      from dual
    SCOTT_ENAM KING_ENAME
    SCOTT      KING 

  • When I quit itunes it restarts again with the dot under the itunes logo but the iTunes window doesn't open until I click the icon on the dock.  Also in the middle of the size vale in the size column the value starts with a number then a ? then a number.

    When I quit itunes it restarts again with the dot under the itunes logo but the iTunes window doesn't open until I click the icon on the dock.  Also in the middle of the size vale in the size column the value starts with a number then a ? then a number.

    This forum is for questions from those managing sites on iTunes U, Apple's service for colleges and universities to post educational material in the iTunes Store. You'll be most likely to get help with this issue if you ask in the general iTunes for Mac forums.
    Regards.

  • Help needed to mark or highlight certain columns in Data Modeler

    Hi there,
    We use the data modeler to present our data model to the security department to explain/prove for which columns we ran a data masking/anonymization function. I am looking for any kind of way to either highlight or change a set of columns across all tables. So far I could only identify the red dot for “not null” and the option to introduce a ADT/UDT like “ANONYMIZED” to show in the graphical representation what we have done. As we base our DM on empty tables for decent overviews including the PK/FK relationships we are quite flexible. Still the “misusage” of ”Not Null” or ADT/UDT columns does not go together with the required PK/FK’s. Does anyone know a way to mark or highlight certain columns automatically when importing a data dictionary? (Unfortunately RDBMS comments do not get included in any overview). Thanks a lot. Cheers Stefan

    Hi Philip, Thanks a lot for puting this enhancement request through.
    Just downloaded the latest Patch upgrading to v 3.1.2-704 and confirmed that this functionality is not available yet.
    Keeping your experience in mind what kind of expectation to you have for the approval and realization of your request?
    Most likely this will take a couple of month – right? Or is there a beta version of 3.2 already available we could use.
    Thanks a lot. Cheers Stefan

  • TS1347 Dear apple, The governments of Saudi Arabia has changed its weekend from THR&FRI to FRI&SAT, Therefore the start day of the week became SUN. unfortunately all Iphone user could not adjust this change on their I phones . So will you  please facilita

    Dear apple,
    The governments of Saudi Arabia has changed its weekend from THR&FRI to FRI&SAT,
    Therefore the start day of the week became SUN. unfortunately all Iphone user could not adjust this change on their I phones .
    So will you  please facilitate us on this matter.
    Regards

    Give apple feedback regarding this.
    For a temporary fix, change your region? Get a 3rd party Calendar app that fits your needs?
    I assume your current region is set in the photo?
    If so, pick a region that has a start day of Sunday. (either historically or known for the present)
    Note, with changing your region, it will change the default phone number prefix/country code for new contacts and addresses. (calling and SMS is not affected)

Maybe you are looking for