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

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

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

½Ð°Ý§Ú¦b¤@­Ó¬¡­¶³¡¤º, ¦³¤@­Ó¤u§@ªí"¥Ø¿ý"¬O¦³«ö¶s¨Ã³]¦³¥¨¶°, ¦]¬¡­¶³¡¦³¦h¤H¨Ï¥Î, §Ú±N¤u§@ªí"¥Ø¿ý"«OÅ@, ¦ý¤´¬O¥i¥H«öÁä°õ¦æ¥¨¶°, ¥u¬O¤£¯à­×§ï¤u§@ªí¤º®e.

½Ð°Ý°£¤FÁôÂäu§@ªí¥~, ©|¦³¬Æ»ò¤èªk?

½Ð½ç±Ð!

¦^´_ 1# missbb


   «ö¶s¥²¶·¬OActiveX¬O±±¨î¶µ
¨äÄݩʬ°.Enabled¡A¥i±±¨î¥i¨Ï¥Î©Î¤£¥i¨Ï¥Î
¨Ò¦p¡G
CommandButton1.Enabled = False'¬°¤£¥i¨Ï¥Î
CommandButton1.Enabled =True'¬°¥i¨Ï¥Î

·íµM§A¥²¶·¼g¤@¥¨¶°¡A§Q¥Î±K½X¨Ó´x±±¥i§_¨Ï¥Î
¦b Workbook_OpenÃö³¬¨Ï¥Î¦p¤U
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 = False
End If
End Sub

TOP

¦^´_ 2# lpk187

·PÁ¸ѵª!:) ¤¤¬î¸`§Ö¼Ö!

TOP

¦^´_ 2# lpk187
§A¦n, §Ú¥[¤J¤F±K½X¿ù»~¥X²{MSGBOX¤Î°h¥X, ¦ýCOMMANDBUTTONÅܤF¦Ç¦â, ½Ð°Ý°ÝÃD¦b¨º??¨D«üÂI? 03 VBA ¥t¦s·sÀÉ OK 20150928.rar (27.31 KB)
  1. Private Sub CommandButton1_Click()
  2. Call Splitbook
  3. End Sub

  4. Sub Splitbook()

  5. aa = InputBox("½Ð¿é¤J±K½X")
  6. pass = "12345"
  7. If aa = pass Then
  8.     CommandButton1.Enabled = False
  9. If aa <> pass Then
  10. MsgBox "¿ù»~¿é¤J"
  11. End If

  12. End If


  13. Dim xPath As String
  14. xPath = Application.ActiveWorkbook.Path
  15. Application.ScreenUpdating = False
  16. Application.DisplayAlerts = False
  17. For Each xWs In ThisWorkbook.Sheets
  18.     xWs.Copy
  19.     Application.ActiveWorkbook.SaveAs Filename:=xPath & "\" & xWs.Name & ".xlsx"
  20.     Application.ActiveWorkbook.Close False
  21. Next
  22. Application.DisplayAlerts = True
  23. Application.ScreenUpdating = True
  24. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# missbb


    If aa = pass Then
    CommandButton1.Enabled = False<<³o¸ÌÀ³¸Ó¬°True¤~¹ï¡A¤£¦n·N«ä¡C

TOP

¦^´_ 5# lpk187

§Ú¸Õ¤FOK, ¦ý¦p±K½X¤£²Å«o¨S¦³¥X²{MSGBOX, ¦Ó·|Ä~Äò°õ¦æÀx¦s, ¬OCALLªº¿ù»~?

:dizzy: 03 VBA ¥t¦s·sÀÉ OK 20150928 v2.rar (28.09 KB)

TOP

¦^´_ 6# missbb
¸Õ¸Õ¬Ý
  1. aa = InputBox("½Ð¿é¤J±K½X")
  2.     pass = "12345"
  3.     If aa = pass Then
  4.         CommandButton1.Enabled = False
  5.     ElseIf aa <> pass Then
  6.         MsgBox "¿ù»~¿é¤J"
  7.         CommandButton1.Enabled = True
  8.     End If
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 6# missbb


    aa = InputBox("½Ð¿é¤J±K½X")
pass = "12345"
If aa = pass Then
    CommandButton1.Enabled = True
Else
    CommandButton1.Enabled = False
    MsgBox "¿ù»~¿é¤J"
    Exit Sub
End If

TOP

¦^´_ 8# lpk187

©êºp¥´ÂZ¤F, ¸Õ¤F¨â¦ì¤j¤jªº¤èªk, ©|¦³¤p°ÝÃD:

GBKEEªº¤èªk, ±K½X¹ï®ÉµL°ÝÃD, ¦ý¦p±K½X¿ù»~«á, ¤´·|°õ¦æ.

Lpk187ªº¤èªk, ¤£½×±K½X¹ï®ÉµL°ÝÃD, ¦ý°õ¦æVBA«á«ö¶sÅܦÇ, Ãö³¬ÀɮצA¶}, «ö¶s¤´¬O¦Ç¦â. ¦p±K½X¿ù»~«á, «ö¶sÅܦÇ, Ãö³¬ÀɮצA¶}, «ö¶s¤´¬O¦Ç¦â.

TOP

¦^´_ 7# GBKEE

©êºp¥´ÂZ¤F, ¸Õ¤F¨â¦ì¤j¤jªº¤èªk, ©|¦³¤p°ÝÃD:

GBKEEªº¤èªk, ±K½X¹ï®ÉµL°ÝÃD, ¦ý¦p±K½X¿ù»~«á, ¤´·|°õ¦æ.

Lpk187ªº¤èªk, ¤£½×±K½X¹ï®ÉµL°ÝÃD, ¦ý°õ¦æVBA«á«ö¶sÅܦÇ, Ãö³¬ÀɮצA¶}, «ö¶s¤´¬O¦Ç¦â. ¦p±K½X¿ù»~«á, «ö¶sÅܦÇ, Ãö³¬ÀɮצA¶}, «ö¶s¤´¬O¦Ç¦â.

TOP

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD