- ©«¤l
- 354
- ¥DÃD
- 5
- ºëµØ
- 0
- ¿n¤À
- 387
- ÂI¦W
- 0
- §@·~¨t²Î
- windows7
- ³nÅ骩¥»
- vba,vb,excel2007
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2017-1-8
- ³Ì«áµn¿ý
- 2024-8-2
|
¥»©«³Ì«á¥Ñ singo1232001 ©ó 2022-8-18 23:52 ½s¿è
¦^´_ 7# av8d
Sub test()
Set Sc = Sheets("¨t²ÎÀÉ").ComboBox1
Sc.Clear
For i = 11 To -11 Step -1
w = Weekday(Date - i, 2)
If w >= 1 And w <= 5 Then Sc.AddItem Format(Date - i, "yyyy/m/d") & " " & WeekdayName(w, 1, 2)
Next
Select Case Weekday(Date, 2)
Case Is = 1, 5: Sc.Text = Format(Date + 4, "yyyy/m/d") & " " & WeekdayName(Weekday(Date + 4, 2), 1, 2)
Case Is = 2, 6: Sc.Text = Format(Date + 3, "yyyy/m/d") & " " & WeekdayName(Weekday(Date + 3, 2), 1, 2)
Case Is = 3: Sc.Text = Format(Date + 2, "yyyy/m/d") & " " & WeekdayName(Weekday(Date + 2, 2), 1, 2)
Case Is = 4: Sc.Text = Format(Date + 1, "yyyy/m/d") & " " & WeekdayName(Weekday(Date + 1, 2), 1, 2)
End Select
End Sub
1. Sheets("¨t²ÎÀÉ").ComboBox1 ¥i¥HÁY¼g¦¨§A·Qn¨ì¦WºÙ
2.¦h±ø¥ó§PÂ_ ¥i¥H½m²ß¨Ï¥Îselect case ·íµMif¤]¨S°ÝÃD
·|¥Îªºì¦]¬O ·í¦h±ø¥ó¤º³¡ ¥¼¨Ó¥X²{¦h¼h§PÂ_®É ¥i¥Hselect case + if then ·f°t ¤ñ¸û¦n¤À¿ë
Y§¹¦¨«á ¤]¥i¥Hª½±µ¥þ³¡¨Ï¥Îwith Sheets("¨t²ÎÀÉ").ComboBox1 ªº¤è¦¡¥þ¥]°_¨Ó |
|