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

[µo°Ý] VBA³]©w¤u§@ªí«OÅ@»P¸Ñ°£

[µo°Ý] VBA³]©w¤u§@ªí«OÅ@»P¸Ñ°£

¥»©«³Ì«á¥Ñ taiwan ©ó 2014-11-10 13:27 ½s¿è

§Ú¦³¤@­Ó¸ê®ÆSheet ºÙ¬°sample

§Ú¦b¦¹¸ê®Æªí¤º³]¤@­Ó«ö¶s,³o«ö§á¥\¯à·|¹ï sample¸ê®Æ¤º®e¶i¦æ§ó·s
¬°¤FÁקK¨Ï¥ÎªÌ§â¸ê®Æ«ö¨ìªÅ¥ÕÁ䤧Ãþ,©Î»~IJ


©Ò¥H­n³]¸m±K½X

¨º¦b¥\¯àÅÞ¿è¤W­n¥ý³]¸Ñ°£¤u§@ªí±K½X¦b³]«OÅ@¤u§@ªí±K½X

¨º³o¼Ë¤l¦b§ó·s¸ê®Æ¤º®e®É¤ñ¸û¤£·|¦³»~

¦b°õ¦æµ{¦¡«áµo²{¦³¤@­Ó°ÝÃD¬O ¥ý¸Ñ°£±K½Xªºsub¥\¯à¥¢®Ä

¾É­P¸ê®ÆµLªk¼g¤J§ó·s  ·|¥X²{1004¿ù»~¥N½X


µ{¦¡½X¦p¤U:

'«OÅ@¤u§@¦Cªí
  1. Sub LockLong()
  2.     On Error Resume Next
  3.    
  4.     ActiveSheet("sample").Unprotect "1234"

  5.    ActiveSheet("sample").Protect Password:="1234", DrawingObjects:=True, Contents:=True, Scenarios:=True
  6.    ActiveSheet("sample").EnableSelection = xlNoRestrictions


  7. End Sub
½Æ»s¥N½X

¦Û¤v¨Ó¦^µª¤]¤À¨É¦U¦ì

1.¤£­n³]«OÅ@¤Î¸Ñ°£«OÅ@¦U¤@­Ósub
2.±K½X¬°¤j¤p¼g½Ð³£§ï¬°¤p¼g
3.Unprotect ¤ÎProtect³£­n¦b«á­±¦h¼g¤@¬q  Password:=½T«O°õ¦æ¤W¥i¦æ
  1.     Sub LockLong()
  2.         On Error Resume Next
  3.       
  4.         ActiveSheet("sample").Unprotect  [color=Red]Password:[/color]="1234"

  5.        ActiveSheet("sample").Protect Password:="1234", DrawingObjects:=True, Contents:=True, Scenarios:=True
  6.        ActiveSheet("sample").EnableSelection = xlNoRestrictions


  7.     End Sub
½Æ»s¥N½X

TOP

ÁÙ¦³¤@­Ó°ÝÃD

»yªk¤¤¥H¤U¦¹»yªk¦b§ÚexcelµLªk¨Ï¥Î
  1. ActiveSheet("xxx").Protect Password:="1234"
½Æ»s¥N½X
§Ú±o¥Î¥H¤U³oÂ_¤~¯à°õ¦æ «Ü¯Ç´e
  1. Workbooks("xxx").Worksheets("xx").Protect Password:="1234"
½Æ»s¥N½X

TOP

¦^´_ 3# taiwan
  1. Sub Ex()
  2. Sheets("xxx").Protect "1234"
  3. '©Î¬O
  4. ActiveSheet.Protect "1234"
  5. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_  taiwan
GBKEE µoªí©ó 2014-11-11 15:59



  §Ú·|¦b¸Õ¸Õ¬Ý

TOP

        ÀR«ä¦Û¦b : ¥ÌÄ@°µ¡BÅw³ß¨ü¡C
ªð¦^¦Cªí ¤W¤@¥DÃD