Draft

From CleanPosts

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
Function DaysInMonth(FullDate As String, sDay As String) As Integer
+
Function IsFormula(Check_Cell As Range)
-
Dim i As Integer
+
     IsFormula = Check_Cell.HasFormula
-
Dim iDay As Integer
+
-
Dim iDay As Integer, iMatchDay As Integer
+
-
Dim iDaysInMonth As Integer
+
-
Dim FullDateNew As Date
+
-
 
+
-
iMatchDay = Weekday(FullDate)
+
-
Select Case UCase(sDay)
+
-
Case "SUN"
+
-
iDay = 1
+
-
Case "MON"
+
-
iDay = 2
+
-
Case "TUE"
+
-
iDay = 3
+
-
Case "WED"
+
-
iDay = 4
+
-
Case "THU"
+
-
iDay = 5
+
-
Case "FRI"
+
-
iDay = 6
+
-
Case "SAT"
+
-
iDay = 7
+
-
End Select
+
-
iDaysInMonth = Day(DateAdd("d", -1, DateSerial _
+
-
          (Year(FullDate), Month(FullDate) + 1, 1)))
+
-
FullDateNew = DateSerial(Year(FullDate), Month(FullDate), iDaysInMonth)
+
-
     For i = iDaysInMonth - 1 To 0 Step -1
+
-
          If Weekday(FullDateNew - i) = iDay Then
+
-
              DaysInMonth = DaysInMonth + 1
+
-
          End If
+
-
    Next i
+
End Function
End Function

Revision as of 17:45, 22 February 2019

Function IsFormula(Check_Cell As Range)

   IsFormula = Check_Cell.HasFormula

End Function

Personal tools
Strangers In Paradise
Terminal Cruise