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

[µo°Ý] ¦p¦ó¦bEXCEL 2010 ¸T¤î½Æ»s°Å¤U¶K¤W

[µo°Ý] ¦p¦ó¦bEXCEL 2010 ¸T¤î½Æ»s°Å¤U¶K¤W

¦U¦ì«e½ú¦n
¦p¤U¹Ï¡A·Q½Ð°Ý¦³¨S¦³¿ìªk§âEXCEL2010ª©ªº¬õ¦â®Ø½u¤@¨Ö¸T¤î©O¡H

¥Ø«e±qºô¸ô·j´Mµ²ªG¥u¦³ §Ö±¶Á䳡¤À ¥H¤Î ¥kÁä¿ï³æ ¥i¥H¸T¤î¡C
¦pªþ¥ó ¸T¤î½Æ»s°Å¤U¶K¤W.rar (14.1 KB)

¨Ï¥Î"¤u¨ã"-->«OÅ@-->«OÅ@¤u§@ªí

TOP

¨Ï¥Î"¤u¨ã"-->«OÅ@-->«OÅ@¤u§@ªí
twispin µoªí©ó 2015-4-16 10:09


«e½ú¡I³o¤èªk¦æ¤£³q§r¡IÁÙ¬O¥i¥H½Æ»s.....:(

TOP

¦^´_ 3# justintoolbox
¬O­n¥uµ¹¬Ý¹À?
¸Õ¸Õ¤Ä¿ï³o­Ó

TOP

  1. '*** In the ThisWorkbook Module ***
  2. Option Explicit

  3. Private Sub Workbook_Activate()
  4.     Call ToggleCutCopyAndPaste(False)
  5. End Sub

  6. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  7.     Call ToggleCutCopyAndPaste(True)
  8. End Sub

  9. Private Sub Workbook_Deactivate()
  10.     Call ToggleCutCopyAndPaste(True)
  11. End Sub

  12. Private Sub Workbook_Open()
  13.     Call ToggleCutCopyAndPaste(False)
  14. End Sub
  15. '*** In a standard module ***
  16. Option Explicit

  17. Sub ToggleCutCopyAndPaste(Allow As Boolean)
  18.      'Activate/deactivate cut, copy, paste and pastespecial menu items
  19.     Call EnableMenuItem(21, Allow) ' cut
  20.     Call EnableMenuItem(19, Allow) ' copy
  21.     Call EnableMenuItem(22, Allow) ' paste
  22.     Call EnableMenuItem(755, Allow) ' pastespecial
  23.      
  24.      'Activate/deactivate drag and drop ability
  25.     Application.CellDragAndDrop = Allow
  26.      
  27.      'Activate/deactivate cut, copy, paste and pastespecial shortcut keys
  28.     With Application
  29.         Select Case Allow
  30.         Case Is = False
  31.             .OnKey "^c", "CutCopyPasteDisabled"
  32.             .OnKey "^v", "CutCopyPasteDisabled"
  33.             .OnKey "^x", "CutCopyPasteDisabled"
  34.             .OnKey "+{DEL}", "CutCopyPasteDisabled"
  35.             .OnKey "^{INSERT}", "CutCopyPasteDisabled"
  36.         Case Is = True
  37.             .OnKey "^c"
  38.             .OnKey "^v"
  39.             .OnKey "^x"
  40.             .OnKey "+{DEL}"
  41.             .OnKey "^{INSERT}"
  42.         End Select
  43.     End With
  44. End Sub

  45. Sub EnableMenuItem(ctlId As Integer, Enabled As Boolean)
  46.      'Activate/Deactivate specific menu item
  47.     Dim cBar As CommandBar
  48.     Dim cBarCtrl As CommandBarControl
  49.     For Each cBar In Application.CommandBars
  50.         If cBar.Name <> "Clipboard" Then
  51.             Set cBarCtrl = cBar.FindControl(ID:=ctlId, recursive:=True)
  52.             If Not cBarCtrl Is Nothing Then cBarCtrl.Enabled = Enabled
  53.         End If
  54.     Next
  55. End Sub

  56. Sub CutCopyPasteDisabled()
  57.      'Inform user that the functions have been disabled
  58.     MsgBox "Sorry!  Cutting, copying and pasting have been disabled in this workbook!"
  59. End Sub
½Æ»s¥N½X

TOP

«e½ú­Ì¡A¤pªº¶K¤W¥N½X¤F¦p¤W¡A«e½ú­Ì¥Ø«e´£¨Ñªº¬O¡y¸T¤î¿ï¾ÜÀx¦s®æ¡z¨Ó¹F¨ì¸T¤î½Æ»sªº¥Øªº¡A¦ý¬O§Ú§Ú¶È­n¡y¸T¤î½Æ»s¡B°Å¤U¡B¶K¤W¡z¡A­n¯à«O¯d¥i¥H¿ï¾ÜÀx¦s®æ¡]¦]¬°­Y­n¿z¿ï¬Y¨ÇÀx¦s®æ´N»Ý­n¿ï¾Ü¤F¡^¡C·P®¦¡I¦³µL§ó¦nªº¤èªk©O¡H¡H¡H

TOP

¥Ø«e§ä¨ì¤@­Ó¤èªk¬O¶}±Ò¬¡­¶Ã¯´N¥ý§âRIBBONµ¹ÁôÂð_¨Ó¡C¥N½X¦p¤U
¡]¸ê®Æ¨Ó·½¡Ghttp://www.mrexcel.com/forum/excel-questions/634090-visual-basic-applications-hide-ribbon-others-how-limit-one-workbook.html¡^
  1. Private Sub Workbook_Activate()

  2.     Application.ScreenUpdating = False
  3.     Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
  4.     Application.DisplayFormulaBar = False
  5.     Application.DisplayStatusBar = Not Application.DisplayStatusBar
  6.     ActiveWindow.DisplayWorkbookTabs = False
  7.     Application.ScreenUpdating = True

  8. End Sub
½Æ»s¥N½X
  1. Code:
  2. Private Sub Workbook_Deactivate()

  3.     Application.ScreenUpdating = False
  4.     Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
  5.     Application.DisplayFormulaBar = True
  6.     Application.DisplayStatusBar = True
  7.     Application.ScreenUpdating = True

  8. End Sub
½Æ»s¥N½X
¦ý¶ñ¤J¤W­±«á¡A´Nµo²{¤@­Ó°ÝÃD¡G´N¬O¤£¯à¥Î§Ö±¶Áä¿z¿ï¤F¡I«ç»ò¿ì¡H
§Ú·Q­n¸T¤î½Æ»s°Å¤U¶K¤Wªº¥\¯à¡A¦ý¿z¿ïªº¥\¯àÁÙ¬O»Ý­n¡A½Ð°Ý³o¸Ìªº°ª¤â«e½ú
¦³¨S¦³§ó¦nªº¤èªk©O¡H¡H

TOP

§ÚÁÙ¦³¸Õ¹LIRMªº»{ÃÒ¤èªk¡A¥L¥i¥H¥Î±ÂÅvªº¤è¦¡µ¹¤©¤TºØ¡yŪ¨ú¡z¡A¡yÅܧó¡z¡B¡y§¹¥þ±±¨î¡z¡C
¡yŪ¨ú¡z¡G¸T¤î¥ô¦ó½Æ»s°Å¤U¶K¤Wªº¥\¯à¡]ribbon¤Wªº¤]¸T¤î¤F¡^¡A¦ý¬O§Ú­nªº¿z¿ï¤]¤@¨Ö¤£¯à¨Ï¥Î¡C
¡yÅܧó¡z¡G¯à½Æ»s°Å¤U¶K¤W--->©Ò¥H¤£¬O§Ú­nªº¡C

¦³¨S¦³¤¶©óŪ¨ú»PÅܧ󤧶¡ªº
¦p¤U¹Ï¡A¶È§â¡yÀ˵ø¡z»P¡y½s¿è¡z±Â»P©O¡H

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD