AlOmmda
09-30-2005, 10:55 AM
سلامٌ عليكم؛
سوف أقوم بوضع بعض الـ Functions التى قمت بكتابتها منذ فتره و التى يمكن أن تٌستخدم فى الـ Visual Basic for Application أو VB و ذللك عندم يسمح لى الوقت.
الـFunction الآولى تقوم بحساب الآيام فى أى شهر للسنه الحاليه و يتم نذاءها كما يلى
DaysOfMonth(2) و سوف تعطى 28 و هو عدد أيام شهر شباط فبراير لعام 2005
Function DaysOfMonth(anyMonth As Byte) As Integer
' De******ion: Computes the days
of any given month of the current year
Dim anyDate As Date
Dim nDays As Integer
anyDate = DateSerial(Year(Date), anyMonth, 1)
' Adding one month to the given date then
calculate the Difference between the two dates
nDays = DateSerial(Year(anyDate), Month(anyDate) + 1, Day(anyDate)) _
- DateSerial(Year(anyDate), Month(anyDate), Day(anyDate))
DaysOfMonth = nDays
End Function
أتمنى أن أكون قدمت لكم شيى مفيدأ
سلام
سوف أقوم بوضع بعض الـ Functions التى قمت بكتابتها منذ فتره و التى يمكن أن تٌستخدم فى الـ Visual Basic for Application أو VB و ذللك عندم يسمح لى الوقت.
الـFunction الآولى تقوم بحساب الآيام فى أى شهر للسنه الحاليه و يتم نذاءها كما يلى
DaysOfMonth(2) و سوف تعطى 28 و هو عدد أيام شهر شباط فبراير لعام 2005
Function DaysOfMonth(anyMonth As Byte) As Integer
' De******ion: Computes the days
of any given month of the current year
Dim anyDate As Date
Dim nDays As Integer
anyDate = DateSerial(Year(Date), anyMonth, 1)
' Adding one month to the given date then
calculate the Difference between the two dates
nDays = DateSerial(Year(anyDate), Month(anyDate) + 1, Day(anyDate)) _
- DateSerial(Year(anyDate), Month(anyDate), Day(anyDate))
DaysOfMonth = nDays
End Function
أتمنى أن أكون قدمت لكم شيى مفيدأ
سلام
