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

[µo°Ý] ¦p¦ó¸T¤î¨Ï¥ÎVBA«ö¶s

Sub Splitbook()
AA = InputBox("½Ð¿é¤J±K½X")
If AA = "" Then Exit Sub
If AA <> "12345" Then MsgBox "¡°±K½X¿ù»~! ": Exit Sub
¡@
¡ã¡ã±µ¥t¦sÀɵ{¦¡½X¡ã¡ã
End Sub

±K½X¥¼¿é¤J©Î¿ù»~¡Aª½±µ¸õ¶}¡A¤£»Ý¹ï«ö¶s¥t§@³B²z¡ã¡ã

TOP

¦^´_ 11# ­ã´£³¡ªL

¦¨¥\¤F, ·PÁ«ü¾É.

TOP

¦^´_ 9# missbb


    §AÀ³¸Ó¬Ý²M·¡2¼Óªº¸Ñ»¡¡A
CommandButton1.Enabled = False'¬°¤£¥i¨Ï¥Î¡A·|Åܦ¨¦Ç¦âªº
CommandButton1.Enabled =True'¬°¥i¨Ï¥Î¡A·|¦¨¬°¥¿±`¥i¨Ï¥Î±¡ªp
¡A¦Ó2¼Óªº¨Ò¤l
¦b Workbook_Open®É¡A·|Ãö³¬«ö¶sªº¨Ï¥Î¡Aª½¨ì°õ¦æpasµ{¦¡®É¤è¥i¸Ñ¶}«ö¶sªº¨Ï¥Î
Private Sub Workbook_Open()
Worksheets("¤u§@ªí1").CommandButton1.Enabled = False
End Sub
¤U¦A§Q¥Î¥¨¶°¨Ó±Ò¥Î¥¦
Private Sub pas_Click()
  aa = InputBox("½Ð¿é¤J±K½X")
pass = "12345"
If aa = pass Then
    CommandButton1.Enabled = True'±K½X¹ï®É¡A«hCommandButton1«ö¶sÅÜ¥i¥H¨Ï¥Î¡A
Else
    CommandButton1.Enabled = False'±K½X¿ù»~®É¡A«hCommandButton1«hºû«ù¤£²Õ¨Ï¥Î¡A«ö¶s¬°¦Ç¦âªº
    MsgBox "¿ù»~¿é¤J"
    Exit Sub'±K½X¿ù»~®É¸õ¥Xµ{¦¡¡A¬Æ¦Ü¤£¯à°õ¦æ¤U­±µ{¦¡
End If

...
...
...

End Sub
³oµ{¦¡¨Ò¤l¡A¬O»¡©ú¡A·í¥´¶}Àɮ׮ɡACommandButton1«ö¶s¬°¤£¥i¥H¨Ï¥Î¡A
ª½¨ì¨Ï¥ÎªÌ¡A«ö¤Upas «ö¶s®É¡A±K½X¹ï®É¡A¤~¥i¥H¨Ï¥ÎCommandButton1«ö¶s¡AÄ~Äò¥i¥H¨Ï¥Î¨ä¥L¥¨¶°µ{¦¡§_«h¬°«OÅ@ª¬ºA¡I¦p¤U¹Ï¡G
¶}±ÒÀɮ׮ɡACommandButton1«ö¶s¬°¤£¦ó¨Ï¥Îª¬ºA

¤U¹Ï«h¬°¡A±K½X¿é¤J¹ï«á¥i¨Ï¥Îª¬ºA

TOP

¦^´_ 13# lpk187


¦hÁ«ü¾É!

TOP

¥»©«³Ì«á¥Ñ koo ©ó 2015-10-24 16:39 ½s¿è

«Øij¤@¤U:¿é¤J¹ï¤F´N°õ¦æµ{§Ç..¿é¤J¿ù»~´NÂ÷¶}Sub
¦A§âµ{§Ç¤WÂê
¤£µM·|¦³"«ö¶s¤´¬O¦Ç¦â"°ÝÃD
  1. Private Sub CommandButton1_Click()
  2. x = InputBox("½Ð¿é¤J±K½X", "±K½X")
  3. If x = 12345 Then
  4.     Call Splitbook
  5. Else
  6.     MsgBox "¿é¤J¿ù»~"
  7.     Exit Sub
  8. End If
  9. End Sub

  10. Sub Splitbook()
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ·R¤£¬O­n¨D¹ï¤è¡A¦Ó¬O­n¥Ñ¦Û¨­ªº¥I¥X¡C
ªð¦^¦Cªí ¤W¤@¥DÃD