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

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

¦^´_ 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

¦^´_ 4# missbb


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

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

¦^´_ 2# lpk187

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

TOP

¦^´_ 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

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