ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð±Ð¦p¦ó¸õ¹L©P¤»©P¤é¨â¤Ñ¤£ºâ?

[µo°Ý] ½Ð±Ð¦p¦ó¸õ¹L©P¤»©P¤é¨â¤Ñ¤£ºâ?

½Ð±Ð¸õ¹L©P¤»©P¤é¨â¤Ñ¤£ºâ¦¹µ{§Ç¦p¦ó§ï?
sub test()
Dim rng
For Each rng In Range("AE4:AE15")
If rng <> "" And Month(rng) = Month(Date) And Year(rng) = Year(Date) Then
If Day(Date) - Day(rng) < 4 And Day(Date) - Day(rng) >= 0 Then '«e¤T¤Ñ¨ì·í¤é
MsgBox Day(Date) - Day(rng)
End If
End If
Next
end sub

¥»©«³Ì«á¥Ñ t8899 ©ó 2014-10-25 22:17 ½s¿è

·Q¤F¤@­Ó¤p®É  :-(
Sub MA3333()
Dim rng, k, abc, date2
For Each rng In Range("AE4:AE15")  
If rng <> "" And Month(rng) = Month(Date) And Year(rng) = Year(Date) Then
'------------------------------abc¨D¥X©P¤»©P¤é¦@´X¤Ñ
abc = 0
date2 = Date
date2 = date2 - 1
For k = 1 To rng - date2  
date2 = date2 + 1
If Weekday(date2) = 1 Or Weekday(date2) = 7 Then abc = abc + 1
Next              
'-----------------------------abc¨D¥X©P¤»©P¤é¦@´X¤Ñ
If Day(rng) - Day(Date) - abc < 4 And Day(rng) - Day(Date) >= 0 Then '«e¤T¤Ñ¨ì·í¤é³qª¾
MsgBox  "«e " & Day(rng) - Day(Date)& " ¤Ñ³qª¾
End If  
End If         
'-----
Next
End Sub

TOP

¦^´_ 2# t8899
   
·Q¤F¤@­Ó¤p®É  :-(
·Q¨ì¤F,´N¬O§Aªº.
¥i°Ñ¦Ò¤@¤U
  1. Option Explicit
  2. Sub Ex()
  3.     Dim rng As Range, E, eDAY As Date, i As Integer
  4.     eDAY = Date
  5.     If Weekday(eDAY, vbMonday) >= 6 Then MsgBox eDAY & " ¬O°²¤é": Exit Sub
  6.     i = IIf(Weekday(eDAY, vbMonday) <= 3, 5, 3)
  7.     For Each rng In Range("AE4:AE15")
  8.         If IsDate(rng) And Int(eDAY - rng) >= 0 And Int(eDAY - rng) <= i Then
  9.             If Weekday(rng, vbMonday) < 6 Then
  10.                 MsgBox rng & " «e " & Int(eDAY - rng) & " ³qª¾"               
  11.             End If
  12.         End If
  13.     Next
  14. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  t8899
     ·Q¨ì¤F,´N¬O§Aªº.
¥i°Ñ¦Ò¤@¤U
GBKEE µoªí©ó 2014-10-26 09:04

Weekday §Ú¤£¬O¤F¸Ñªº«Ü¥J²Ó........·PÁ«ü¾É!

TOP

        ÀR«ä¦Û¦b : ±o²z­nÄǤH¡A²zª½­n®ð©M¡C
ªð¦^¦Cªí ¤W¤@¥DÃD