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

[µo°Ý] ½Ð°Ý¦bThisWorkbook³]©wÅܼƥX²{ªÅ¥Õ³oºØ±¡ªp¦p¦ó³B²z

[µo°Ý] ½Ð°Ý¦bThisWorkbook³]©wÅܼƥX²{ªÅ¥Õ³oºØ±¡ªp¦p¦ó³B²z

½Ð±Ð¦U¦ì¤j¤j¡I
¦bThisWorkbook¸Ì
¼g
Sub worksheet_open()
one=99
end Sub
µM«á¦b¼Ò²Õ¸Ì¼g¤U
Sub My()
Dim MyTime, MyStr, timeend

MyTime = Sheets("Sheet4").Range("C2")

MsgBox one '§Æ±æÅã¥Üone¬°99
MyStr = Format(MyTime, "00:00:00")
MsgBox MyStr
Sheets("Sheet4").Range("C3") = MyStr
If Sheets("Sheet4").Range("A3") > MyTime Then
timeend = ("13:45:00 > 13:44:59")
MsgBox timeend
End If

If Sheets("Sheet4").Range("A3") < MyTime Then
timeend = ("08:45:00 < 13:44:59")
MsgBox timeend
End If
End Sub
==================================
§Æ±æ¬õ¦âÅã¥Ü¥X¨Ó99¡Aµ²ªG¥X²{ªÅ¥Õ¡A
½Ð±Ð³o¬O¬°¤°»ò¡H
ÁÂÁ¦U¦ì¤j¤j­@¤ßÆ[¬Ý¡I
¤H¥Í¥u¦³¤T¤Ñ¡A¥u¦³¬¡¦b¤µ¤Ñ³Ì½ñ¹ê

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2014-7-2 16:07 ½s¿è

¦^´_ 1# barrykuo
¦b§Aªº½d¨Ò¤¤¡A¦b ThisWorkbook ¤º¿é¤J¤F¡G
  1. Sub worksheet_open()
  2.     one = 99
  3. End Sub
½Æ»s¥N½X
¦¹ worksheet_open() «Y¬°§A¦Û«Øªº¨Ï¥ÎªÌ¨ç¦¡¡C
¦b°õ¦æ¼Ò²Õ¤º¤§¨ç¦¡«e¡A§A¥²¶·¥ý¦æ°õ¦æ worksheet_open() ¤@¦¸¡C
¦P®É¦b¼Ò²Õ¤º¤§¨ç¦¡«eªº³Ì¤WºÝ¡A«Å§i¬°
  1. Public one
½Æ»s¥N½X
©Î¬O
  1. Public one As Integer
½Æ»s¥N½X
©ú½T«Å§i¬°¤½¥Î¾ã¼Æ«¬ºA¡C¦p¦¹«K¯à±a¥X¥¿½Tªº  one ­È¡C
  1. ¦b ThisWorkbook ¡G
  2. Sub worksheet_open()
  3.     one = 99
  4. End Sub

  5. ¦b¼Ò²Õ¤º¡G
  6. Public one As Integer

  7. Sub My()
  8.     MsgBox one   '  Åã¥Ü one ¬° 99
  9. End Sub
½Æ»s¥N½X
¦p¦¹»¡©ú¤£ª¾§A¬O§_©úÁA¤F¡H

TOP

¦^´_ 1# barrykuo
°²³]§A¦b½d¨Ò¤¤­ì¥»¬O·Q©ó¶}±Ò Excel ®É¡A¨t²Î¦Û°Ê¦a
·|±N one Åܼƭȱa¤J 99 ªº¼Æ­È¡C¨º¦¹®É§A¥²¶·±N­ì¥»
¿é¤Jªº worksheet_open() ¨ç¥Ü¡A§ï´«¦¨¡G
  1. Private Sub Workbook_Open()
  2.     one = 99
  3. End Sub
½Æ»s¥N½X
¥¦¬O Excel ¥»¨­ªº¤º¦b¨ç¦¡¡A©ó¶}±Ò Excel ®É«K·|¦Û°Ê°õ¦æ¡C
¦Ü©ó¼Ò²Õªº¤½¥ÎÅܼƫŧi«hºû«ù¤£°Ê¡C
  1. Public one As Integer

  2. Sub My()
  3.     MsgBox one   '  Åã¥Ü one ¬° 99
  4. End Sub
½Æ»s¥N½X

TOP

¦^´_ 3# c_c_lai

ÁÂÁÂC_C_lai¤j¤j±zªº¸ÑÄÀ¡A
²Ä¤@
­ì¨Ó§Ú¥´¿ù¤F¡A¤£¬Oworksheet_open()¡AÀ³¸Ó¬Oworkbook_open()¡A
²Ä¤G
Public«Å§i¥Îªk¸g¹L¤j¤j«ü¾ÉÀ´¤F¤@ÂI¡C©Ò¥H©Ò¦³ªºÅܼƳ̦n³£»Ý­n«Å§i¤ñ¸û¦n¡C
·PÁÂ!·PÁÂ!·PÁÂ!
¤H¥Í¥u¦³¤T¤Ñ¡A¥u¦³¬¡¦b¤µ¤Ñ³Ì½ñ¹ê

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD