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

[µo°Ý] Userform¥i¥H§@¨ì§Y®É§ó·s¶Ü¡H

[µo°Ý] Userform¥i¥H§@¨ì§Y®É§ó·s¶Ü¡H

¥»©«³Ì«á¥Ñ »a³· ©ó 2017-9-5 22:13 ½s¿è

¦buserform2¤¤¡A³]¸m¤F¤@­Ótextbox¡A¦WºÙ: TB2
¦ÓTB2­Y¦³¿é¤J¼Æ­È¡A«h Label·|§Y®É§ó·s¡C

TB2¿é¤Jªº®æ¦¡¬°:0800-2000 or 0800-1700
¦Ó¡A¹Bºâ§¹ Label·|§Y®ÉÅã¥Ü¨âªÌ¬Û®t´X¤p®É¡A¥Ø«e¥u¯à¾aµÛ commandButton_Click¨Ó¹F¦¨...
§Æ±æ¥i¥H§@¦¨¦bUserform¤U´N·|¦Û°Ê§ó·s
  1. Dim timebox1, timebox2 As Variant
  2. timebox1 = TimeValue(Mid(TB2, 1, 2) & ":" & Mid(TB2, 3, 2))
  3. timebox2 = TimeValue(Mid(TB2, 6, 2) & ":" & Mid(TB2, 8, 2))
  4. Label9 = (DateDiff("n", DateValue(TB1) & timebox1, DateValue(TB1) & timebox2)) / 60
½Æ»s¥N½X

¦buserform2¤¤¡A³]¸m¤F¤@­Ótextbox¡A¦WºÙ: TB2
¦ÓTB2­Y¦³¿é¤J¼Æ­È¡A«h Label·|§Y®É§ó·s¡C

TB1ªº³¡¥÷¬°¿é¤J¤é´Á: 2016/01/01 or 2017/09/05

TB2¿é¤Jªº®æ¦¡¬°:0800-2000 or 0800-1700
¦Ó¡A¹Bºâ§¹ Label·|§Y®ÉÅã¥Ü¨âªÌ¬Û®t´X¤p®É¡A¥Ø«e¥u¯à¾aµÛ commandButton_Click¨Ó¹F¦¨...
§Æ±æ¥i¥H§@¦¨¦bUserform¤U´N·|¦Û°Ê§ó·s
  1. Dim timebox1, timebox2 As Variant
  2. timebox1 = TimeValue(Mid(TB2, 1, 2) & ":" & Mid(TB2, 3, 2))
  3. timebox2 = TimeValue(Mid(TB2, 6, 2) & ":" & Mid(TB2, 8, 2))
  4. Label9 = (DateDiff("n", DateValue(TB1) & timebox1, DateValue(TB1) & timebox2)) / 60
½Æ»s¥N½X
----------------------------------------------------------------------------------------

¶â...¡A©êºp¡A¦bµoªí³oÃä¤å³¹«á¡A§ä¨ì¤F¥i¥Îªºµª®×
¥Ñ©ó¶W¹L3¤ÀÄÁ¡A¤£¥i¥H¶i¦æ½s¿è¡A©Ò¥H¦^¦b¤U¤èQQ
ÄmÁà¤F....

§Q¥Î TB2_Exitªº¤è¦¡¥h¹F¦¨
  1. Private Sub TB2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
  2. timebox1 = TimeValue(Mid(TB2, 1, 2) & ":" & Mid(TB2, 3, 2))
  3. timebox2 = TimeValue(Mid(TB2, 6, 2) & ":" & Mid(TB2, 8, 2))
  4. Label9 = (DateDiff("n", DateValue(TB1) & timebox1, DateValue(TB1) & timebox2)) / 60
  5. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD