This should do it:
Sub AddMo()
Dim wSheet As Worksheet
Dim NewMonth As Date
Dim NextMonth As Date
Dim Lastmonth As Date
Dim DayInMo As Integer
Dim TheName As String
Dim UsedDays As Integer
Dim DaysUsed(31, 2) As Variant
Dim X As Double
Dim Y As Double
Let NewMonth = InputBox("Please enter the New Month in MM/DD/YYYY format
please: 05/01/2008, etc.")
Let Lastmonth = DateAdd("m", -1, NewMonth)
Let NextMonth = DateAdd("m", 1, NewMonth)
Let DayInMo = NextMonth - NewMonth
For X = 1 To DayInMo
DaysUsed(X, 1) = DateAdd("D", X, NewMonth - 1)
Let TheName = Choose(Weekday(DaysUsed(X, 1)), "Sunday", "Monday",
"Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
If TheName = "Sunday" Or TheName = "Saturday" Then
DaysUsed(X, 2) = 0
Else
Let UsedDays = UsedDays + 1
DaysUsed(X, 2) = 1
End If
Next
Application.ScreenUpdating = False
For Each wSheet In Worksheets
Let TheName = wSheet.Name
Sheets(TheName).Select
'If Cells(1, 1).Value = Lastmonth Then 'can't use this as 1st may be
Sat or Sunday.
If 1 = 1 Then
Rows("1:" & UsedDays).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Y = 0
For X = 1 To DayInMo
If DaysUsed(X, 2) = 1 Then
Y = Y + 1
Cells(Y, 1).Value = NewMonth + X - 1
End If
Next
Cells(1, 1).Select
End If
Next wSheet
End Sub
> Hello Mike,
>
[quoted text clipped - 61 lines]
> > >
> > > Mike