chibi đã viết:Pác nào có hàm "gomonth()" cho tôi xin.
Ví dụ: A1=01/03/2007 (dd/MM/yyyy)
gomonth(A1,3)=01/06/2007; gomonth(A1,-2)=01/01/2007
[b]Function GoMonth(Rng As Variant, iMonth As Integer) As Variant[/b]
If Not IsDate(Rng) Then
GoMonth = "Khong Phai, Ngai Oi!"
Else
GoMonth = DateSerial(Year(Rng), Month(Rng) + iMonth, Day(Rng))
End If
[b]
End Function[/b]