如何设置才能让excel使用者不能打开vba
vba excel \u64cd\u4f5c\u5728\u4f60\u7684Excel\u4e2d\uff0c\u6309Alt+F11 \uff0c\u8c03\u51faVB\u7f16\u8f91\u5668\u3002\u70b9\u51fb\u83dc\u5355\u201c\u63d2\u5165\u201d\u201c\u7528\u6237\u7a97\u4f53\u201d\uff0c\u51fa\u6765\u4e00\u4e2a\u7a97\u4f53\uff0c\u548c\u4e00\u4e2a\u5de5\u5177\u7bb1\u3002\u9009\u62e9\u5de5\u5177\u7bb1\u7b2c\u4e8c\u884c\u6700\u540e\u4e00\u4e2a\u201c\u547d\u4ee4\u6309\u94ae\u201d\uff0c\u5728\u7a97\u4f53\u4e0a\u753b\u4e00\u4e2a\u6309\u94ae\u3002\u7136\u540e\u53cc\u51fb\u6309\u94ae\uff0c\u4ee3\u7801\u5982\u4e0b\u3002
\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d\uff1d
Private Sub CommandButton1_Click()
Sheet1.Columns("e").Copy Sheet2.Columns("a")
Sheet1.Columns("g").Copy Sheet2.Columns("b")
Dim a(1 To 1000) As Single, i As Integer
For i = 1 To 1000 '\u8fd9\u4e24\u5904\u76841000\u6539\u6210\u4f60\u7684\u6700\u5927\u884c\u53f7\uff0c\u8db3\u591f\u5927
a(i) = Val(Sheet1.Cells(i, "a").Value)
Next
For i = 1 To 1000 '\u8fd9\u4e24\u5904\u76841000\u6539\u6210\u4f60\u7684\u6700\u5927\u884c\u53f7\uff0c\u8db3\u591f\u5927
Sheet2.Cells(i, "c").Value = Val(Sheet1.Cells(i, "b").Value) - a(i)
Sheet2.Cells(i, "d").Value = Val(Sheet1.Cells(i, "c").Value) - a(i)
Sheet2.Cells(i, "e").Value = Val(Sheet1.Cells(i, "d").Value) - a(i)
Next
End Sub
\u5f04\u5b8c\u4e4b\u540e\uff0c\u6309F5\u952e\uff0c\u521a\u521a\u5efa\u7acb\u7684\u7a97\u4f53\u5f00\u59cb\u8fd0\u884c\uff0c\u5355\u51fb\u6309\u94ae\uff0c\u4e07\u4e8b\u5927\u5409\u4e86\u3002
Private Sub Workbook_Open()
UserForm1.Show '\u6b64\u5904\u662f\u4f60\u60f3\u663e\u793a\u7684\u7a97\u4f53
Call \u5b8f '\u6b64\u5904\u7684"\u5b8f"\u662f\u4f60\u5f55\u5236\u7684\u5b8f\u540d
End Sub
勾选 查看时锁定工程,然后在下面输入密码,再次打开即可实现保护。
在VBE中点工具、VBAproject属性、保护、填入密码和确认密码就ok了。
绛旓細1. 鎵撳紑Excel琛ㄦ牸銆2. 鐐瑰嚮鈥滄枃浠垛濋夐」鍗★紝鐒跺悗閫夋嫨鈥滀俊鎭濄3. 鍦ㄢ滀俊鎭濋〉闈腑锛屽崟鍑烩滃睘鎬р濇寜閽銆4. 鍦ㄢ滃睘鎬р濆璇濇涓紝鍗曞嚮鈥滄帶鍒惰闂潈闄愨濅笅鐨勨滄洿鏀光濇寜閽5. 鍦ㄢ滄洿鏀规墍鏈夎呭拰鎴愬憳鈥濆璇濇涓紝杈撳叆鏂版墍鏈夎呯殑鍚嶇О鎴栫數瀛愰偖浠跺湴鍧锛岀劧鍚庡崟鍑烩滅‘瀹氣濄1銆佸彸鍑籩xcel琛ㄦ牸锛屽湪寮瑰嚭鐨勫璇...
绛旓細棣栧厛锛岀‘瀹氳〃鏍肩殑缁撴瀯锛屼緥濡傦紝鍒涘缓涓涓寘鍚鍚嶃佸勾榫勫拰鐖卞ソ鐨勮〃鏍硷紝姣忎釜椤圭洰鍗曠嫭鍗犳嵁涓鍒椼傜劧鍚庯紝閫夋嫨鍖呭惈濮撳悕鐨勫崟鍏冩牸锛屾壘鍒拌彍鍗曟爮涓殑鈥滄暟鎹濋夐」锛岀偣鍑烩滄湁鏁堟р濆姛鑳斤紝濡傚浘鎵绀恒傛帴鐫锛屾墦寮寮瑰嚭鐨勫璇濇锛岄夋嫨鈥滃簭鍒椻濊缃傜偣鍑烩滄潵婧愨濆尯鍩熸梺杈圭殑鎸夐挳锛岃繘鍏ュ埌鏂扮殑鐣岄潰锛岃繖閲屼綘闇瑕侀夋嫨浣犳墍瑕佹彁渚涚殑...
绛旓細鍦╒BA 鑿滃崟鏍 鈫 宸ュ叿鈫 VBProject灞炴р啋淇濇姢 鍕鹃 鏌ョ湅鏃堕攣瀹氬伐绋嬶紝鐒跺悗鍦ㄤ笅闈㈣緭鍏ュ瘑鐮侊紝鍐嶆鎵撳紑鍗冲彲瀹炵幇淇濇姢銆
绛旓細1銆佸湪excel鍔熻兘鍖虹偣鍑烩滃闃呪濆垏鎹㈠闃呴夐」锛岀偣鍑烩滃叡浜伐浣滅翱鈥锛屽鏋滃脊鍑轰笅闈㈢浜屼釜瀵硅瘽妗嗭紝鍒欓渶瑕佹牴鎹彁绀鸿繘琛岃缃紝鐐瑰嚮纭畾銆2銆佺偣鍑籩xcel鐨勨滄枃浠垛濇寜閽紝鍦ㄦ枃浠惰彍鍗曚腑锛屾墦寮excel閫夐」瀵硅瘽妗嗐3銆佸湪excel閫夐」瀵硅瘽妗嗙偣鍑诲乏渚х孩妗嗘涓殑鈥滀俊浠讳腑蹇冣濓紝鎺ョ潃鐐瑰嚮鈥滀俊浠讳腑蹇冭缃濇墦寮淇′换涓績璁剧疆锛屽湪淇′换...
绛旓細1. 鍒涘缓涓涓柊鐨凟xcel宸ヤ綔绨匡細鎵撳紑Excel骞跺垱寤轰竴涓柊鐨勫伐浣滅翱锛岀劧鍚庢坊鍔犻渶瑕佸浜哄~鍐欑殑宸ヤ綔琛銆2. 鍚敤鍏变韩锛氬湪Excel涓紝閫夋嫨鈥滄枃浠垛 -> 鈥滃叡浜 -> 鈥滃湪OneDrive涓叡浜濄傚鏋滀綘浣跨敤鍏朵粬浜戝瓨鍌ㄦ湇鍔★紝閫夋嫨鐩稿簲鐨勯夐」銆傜櫥褰曟垨鍒涘缓璐︽埛锛岀劧鍚庡皢宸ヤ綔绨夸繚瀛樺埌浜戝瓨鍌ㄦ湇鍔°3. 娣诲姞鍗忎綔鑰咃細鍦ㄥ叡浜缃...
绛旓細浠ヤ笅閽堝office2010鍜2013鐗堟湰銆俹ffice2007鑿滃崟鏍忎笉鍚岋紝鍔熻兘椤归渶瑕佹壘涓嬨1銆佸乏涓婅鐐瑰嚮鍏ㄩ夎椤垫爣绛 2銆佸彸閿璁剧疆鍗曞厓鏍兼牸寮--淇濇姢--鍙栨秷 閿佸畾鈥3銆佽彍鍗曟爮涓滃闃--淇濇姢宸ヤ綔琛ㄢ濓紝杈撳叆瀵嗙爜锛岀偣鍑荤‘瀹氬嵆鍙傛鏃舵墍鏈夊崟鍏冩牸鍙兘杈撳叆锛屼笉鑳戒慨鏀归鑹层佹牱寮忋佸瓧浣撶瓑锛屼篃涓嶈兘鍒犲姞鍗曞厓鏍笺
绛旓細鏉愭枡/宸ュ叿锛excel2007 1銆侀鍏堥夋嫨瑕浣澶氫汉鑳淇敼鐨勮〃鏍硷紝鐐瑰嚮鎵撳紑銆2銆佹墦寮琛ㄦ牸鍚庯紝鐐瑰嚮涓婄鐨勫闃呰繘鍏ャ3銆佺劧鍚庯紝鐐瑰嚮瀹¢槄閲岀殑鍏变韩宸ヤ綔绨裤4銆佸氨浼氳烦鍑轰竴涓璁剧疆妗嗭紝杩欐椂鍙互鐪嬪埌杩欎釜琛ㄦ牸鏄敱涓涓汉鐙崰鐨勶紝鎶婂厑璁稿鐢ㄦ埛鍚屾椂缂栬緫鎵撲笂鍕俱5銆佹墦涓婂嬀浠ュ悗锛岀偣鍑讳笅绔殑纭畾鎸夐挳淇濆瓨璁剧疆銆6銆佷繚瀛樿缃悗浼...
绛旓細鐢ㄦ暟鎹湁鏁堟璁剧疆銆傞夊畾鍗曞厓鏍煎悗锛屾墽琛屾暟鎹湁鏁堟э紝鍏佽閲岄夊簭鍒楋紝鏉ユ簮閲岃緭鍏ユ兂瑕佺殑閫夐」鍚嶇О锛岀敤閫楀彿闅斿紑锛屽杈撳叆锛氬凡濠,鏈,绂诲紓 纭畾灏卞彲浠ヤ簡銆
绛旓細锛3锛夐変腑鈥滃湪灞忓箷涓婄獊鍑烘樉绀轰慨璁⑩濆閫夋锛岃繖鏍峰湪宸ヤ綔琛ㄤ笂杩涜闇瑕佺殑淇敼鍚庯紝Excel浼氫互绐佸嚭鏄剧ず鐨勯鑹叉爣璁颁慨鏀广佹彃鍏ユ垨鍒犻櫎鐨勫崟鍏冩牸銆傦紙4锛夐変腑鈥滃湪鏂板伐浣滆〃涓樉绀轰慨璁⑩濋夐」锛灏鍚姩鍐茬獊鏃ュ織宸ヤ綔琛ㄣ傦紙5锛夊崟鍑籟纭畾]鎸夐挳锛屽綋寮瑰嚭瀵硅瘽妗嗘彁绀轰繚瀛樺伐浣滅翱鏃讹紝璇峰啀娆″崟鍑籟纭畾]鎸夐挳锛屼繚瀛樺伐浣滅翱銆傘愯浆鑷...
绛旓細灏嗚瀹濂界殑琛ㄦ牸妯℃澘瀵煎叆鐭冲ⅷ鏂囨。锛屾墦寮鍚庣偣鍑诲垎浜紝灏卞彲浠ョ洿鎺ュ鍒剁矘璐寸粰闇瑕佸~鍐欎釜浜轰俊鎭殑甯堢敓浠紝姝ゅ涔熷彲閫氳繃鍒嗕韩浜岀淮鐮佹妸澶氫汉鍗忎綔琛ㄦ牸鍒嗕韩缁欏~鍐欎汉銆傚綋瀵规煇鍗曞厓鏍肩殑鍐呭浜х敓鐤戦棶鏃讹紝鍙互鎻掑叆澶囨敞鍜岃瘎璁猴紝骞朵笖鎻愰啋鎸囧畾浜烘煡鐪嬨傚綋甯堢敓淇℃伅濉啓瀹屾垚鍚庡氨鍙互灏嗚〃鏍煎畬鏁村湴瀵煎嚭銆