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

¤@­Ó«OÅ@°ÝÃD,

¦^´_ 1# 317
±N¸ê®Æ®w(¦rÅéÃC¦â³]»PÀx¦s®æÃC¦â¦P¦â) ³]©w¸ê®Æ®w«OÅ@®É ¤£¤Ä¿ï ¨Ï¥ÎªÌ¥i¨Ï¥Îªº¿ï¶µ
Sheets("¸ê®Æ­¶").Protect Password:="1234", DrawingObjects:=True, Contents:=True, Scenarios:=True
¦b°±¥Î¥¨¶°®É ¸ê®Æ­¶«K¦³«OÅ@¤F

TOP

¦^´_ 8# 317
©Ò³]©w«OÅ@ªº±K½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-12-9 20:18 ½s¿è

¦^´_ 10# 317
§A³o¹Ï¤ù2¬O±M®×³]©w±K½X¥Îªº,¥²»Ý¥Î¤â°Êªº,µLªk¥Îvba¾Þ§@ªº
Sheets("¸ê®Æ­¶").Protect Password:="1234", DrawingObjects:=True, Contents:=True, Scenarios:=True
¤W¦¡¬OÀɮפ¤ ¤u§@ªí¦W¬°"¸ê®Æ­¶"ªº³]©w«OÅ@ªºµ{¦¡½X,¥B³]¥ß±K½X¬°"1234"
¥ý«e§i¶D§A±N¸ê®Æ­¶ªº¦rÅéÃC¦â»PÀx¦s®æªº©³¦â ÃC¦â³]¬°¦P¼ËÃC¦â.
¦pÃö³¬ÀÉ®×®É °õ¦æ¦¹µ{¦¡½X, ¥i¹w¨¾¦A«×¶}±ÒÀÉ®×, ¦p°±¥Î¥¨¶°®É¥B¸ê®Æ­¶¨SÁôÂÃ.±N¤£·|¼ÉÅS¸ê®Æ­¶ªº¤º®e

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-12-24 21:28 ½s¿è

¦^´_ 14# 317
¬¡­¶Ã¯³]¥ß¶}±Ò±K½X,®Ç¤HµLªk¶}±Ò.

TOP

¦^´_ 17# ©P¤j°¶
¦p¤U¹Ï ¿ï¨ú«á ¿é¤J±K½X§Y¥i

TOP

¦^´_ 19# ©P¤j°¶
1.±Nµ{¦¡½X¶K©ó ThisWorkbook,  ±M®×ªºÄÝ©Ê->«OÅ@  ¤Ä¿ïÂê©w±M®×, ¿é¤J±K½X
2.¬¡­¶Ã¯¥t¦sÀɮ׫ü¥O -> ¤u¨ã-> ¤@¯ë¿ï¶µ  ¿é¤J¬¡­¶Ã¯«OÅ@±K½X
  1. Option Explicit
  2. Private Const ±K½X = "1234"
  3. Private Const ¦rÅéÃC¦â = 1
  4. Private Const «OÅ@¦â = 2    '¥i¦Û¦æ­×§ï
  5. Dim Answer$
  6. Private Sub Workbook_Open()
  7.     Sheets_Protect
  8.     Answer_Pass
  9. End Sub
  10. Private Sub Workbook_BeforeClose(Cancel As Boolean)
  11.     Sheets_Protect
  12.     Save
  13. End Sub
  14. Private Sub Workbook_SheetActivate(ByVal Sh As Object)
  15.     Answer_Pass
  16. End Sub
  17. Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
  18.      My_UnProtect (IIf(Answer = ±K½X, True, False))
  19. End Sub
  20. Private Sub Sheets_Protect()
  21.     Dim Sh As Worksheet
  22.     For Each Sh In Sheets
  23.         With Sh
  24.         .Unprotect ±K½X
  25.         .Cells.Font.ColorIndex = «OÅ@¦â
  26.         .Cells.Interior.ColorIndex = .Cells.Font.ColorIndex
  27.         .EnableSelection = xlNoSelection
  28.         .Protect PassWord:=±K½X, DrawingObjects:=True
  29.         End With
  30.     Next
  31. End Sub
  32. Private Sub My_UnProtect(Y As Boolean)
  33.     Application.ScreenUpdating = False
  34.     With ActiveSheet
  35.         .Unprotect ±K½X
  36.         If Y = True Then
  37.             .Cells.Font.ColorIndex = ¦rÅéÃC¦â
  38.             .Cells.Interior.ColorIndex = xlNone
  39.             Application.CommandBars.FindControl(ID:=30029).Enabled = True
  40.         Else
  41.             .Cells.Font.ColorIndex = «OÅ@¦â
  42.             .Cells.Interior.ColorIndex = .Cells.Font.ColorIndex
  43.             .EnableSelection = xlNoSelection
  44.             .Protect PassWord:=±K½X, DrawingObjects:=True
  45.             Application.CommandBars.FindControl(ID:=30029).Enabled = False
  46.         End If
  47.     End With
  48.     Application.ScreenUpdating = True
  49. End Sub
  50. Private Sub Answer_Pass()
  51.     If Answer <> ±K½X Then
  52.         If InputBox("±K½X??", "¿é¤J±K½X") = ±K½X Then Answer = ±K½X
  53.     End If
  54.     My_UnProtect (IIf(Answer = ±K½X, True, False))
  55. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ GBKEE ©ó 2010-12-25 20:42 ½s¿è

¦^´_ 21# ©P¤j°¶
Application.CommandBars.FindControl(ID:=30029).Enabled = False
Control «ü¥O -> «OÅ@(ID:=30029) ªº¨Ï¥Î(°±¤î= False)
¨C¤@Control ¦³¤@¦Û¤vªº ID¸¹¼Æ

TOP

¦^´_ 23# solely
¤£¿ù §AªºÆ[©À«Ü¥¿½T,«OÅ@¤u§@ªí¥u¯à¨¾§g¤l,¤£¯à¨¾¤p¤H. ¥u¦³¬¡­¶Ã¯³]±K½X,¤~¯à«O±K.

TOP

¦^´_ 42# peter460191
41# ªþÀÉ VBA  ThisWorkbook   ¤w§i¶D§A±K½X
  1. Private Sub Workbook_Open()
  2.     Worksheets("Secret").Visible = 2
  3.     If InputBox("½Ð¿é¤J±K½X©Î¨ú®ø") = "123" Then
  4.         MsgBox "USER¡A§A¦n!!"
  5.         'Worksheets("Secret").Visible = -1
  6.         Worksheets("Secret").Visible = xlSheetVisible
  7.         Sheets("Secret").Cells.Font.ColorIndex = 56
  8.     Else
  9.         'MsgBox "§A¦n!!"
  10.         Sheets("Secret").Cells.Font.ColorIndex = 2
  11.         Worksheets("Secret").Visible = 2
  12.     End If
  13. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD