我们经常使用Excel的工作表保护功能 , 将工作表用密码保护起来 , 以防别人操作时进行修改 , 但是这样一来有可能会无法进行一些操作(如输入公式等) , 时间久了保护的密码也有可能忘记了 , 这该怎么办呢?只要按照以下步骤操作 , Excel工作表保护密码瞬间即破!
1、打开您需要破解保护密码的Excel文件;
2、依次点击菜单栏上的工具---宏----录制新宏 , 输入宏名字如:aa;
文章插图
3、停止录制(这样得到一个空宏);
文章插图
4、依次点击菜单栏上的工具---宏----宏,选aa,点编辑按钮;
文章插图
文章插图
5、删除窗口中的所有字符(只有几个),替换为下面的内容;
从横线下开始复制
-----------------------------
OptionExplicit
PublicSubAllInternalPasswords()
'Breaksworksheetandworkbookstructurepasswords.BobMcCormick
'probablyoriginatorofbasecodealgorithmmodifiedforcoverage
'ofworkbookstructure/windowspasswordsandformultiplepasswords
'
'NormanHarkerandJEMcGimpsey27-Dec-2002(Version1.1)
'Modified2003-Apr-04byJEM:Allmsgstoconstants,and
'eliminateoneExitSub(Version1.1.1)
'RevealshashedpasswordsNOToriginalpasswords
ConstDBLSPACEAsString=vbNewLine&vbNewLine
ConstAUTHORSAsString=DBLSPACE&vbNewLine&_
"AdaptedfromBobMcCormickbasecodeby"&_
"NormanHarkerandJEMcGimpsey"
ConstHEADERAsString="AllInternalPasswordsUserMessage"
ConstVERSIONAsString=DBLSPACE&"Version1.1.12003-Apr-04"
ConstREPBACKAsString=DBLSPACE&"Pleasereportfailure"&_
"tothemicrosoft.public.excel.programmingnewsgroup."
ConstALLCLEARAsString=DBLSPACE&"Theworkbookshould"&_
"nowbefreeofallpasswordprotection,somakesureyou:"&_
DBLSPACE&"SAVEITNOW!"&DBLSPACE&"andalso"&_
DBLSPACE&"BACKUP!,BACKUP!!,BACKUP!!!"&_
DBLSPACE&"Also,rememberthatthepasswordwas"&_
"putthereforareason.Don'tstuffupcrucialformulas"&_
"ordata."&DBLSPACE&"Accessanduseofsomedata"&_
"maybeanoffense.Ifindoubt,don't."
ConstMSGNOPWORDS1AsString="Therewerenopasswordson"&_
"sheets,orworkbookstructureorwindows."&AUTHORS&VERSION
ConstMSGNOPWORDS2AsString="Therewasnoprotectionto"&_
"workbookstructureorwindows."&DBLSPACE&_
"Proceedingtounprotectsheets."&AUTHORS&VERSION
ConstMSGTAKETIMEAsString="AfterpressingOKbuttonthis"&_
"willtakesometime."&DBLSPACE&"Amountoftime"&_
"dependsonhowmanydifferentpasswords,the"&_
"passwords,andyourcomputer'sspecification."&DBLSPACE&_
"Justbepatient!Makemeacoffee!"&AUTHORS&VERSION
ConstMSGPWORDFOUND1AsString="YouhadaWorksheet"&_
"StructureorWindowsPasswordset."&DBLSPACE&_
"Thepasswordfoundwas:"&DBLSPACE&"$$"&DBLSPACE&_
"Noteitdownforpotentialfutureuseinotherworkbooksby"&_
"thesamepersonwhosetthispassword."&DBLSPACE&_
"Nowtocheckandclearotherpasswords."&AUTHORS&VERSION
ConstMSGPWORDFOUND2AsString="YouhadaWorksheet"&_
"passwordset."&DBLSPACE&"Thepasswordfoundwas:"&_
DBLSPACE&"$$"&DBLSPACE&"Noteitdownforpotential"&_
"futureuseinotherworkbooksbysamepersonwho"&_
"setthispassword."&DBLSPACE&"Nowtocheckandclear"&_
"otherpasswords."&AUTHORS&VERSION
ConstMSGONLYONEAsString="Onlystructure/windows"&_
"protectedwiththepasswordthatwasjustfound."&_
ALLCLEAR&AUTHORS&VERSION&REPBACK
Dimw1AsWorksheet,w2AsWorksheet
DimiAsInteger,jAsInteger,kAsInteger,lAsInteger
DimmAsInteger,nAsInteger,i1AsInteger,i2AsInteger
Dimi3AsInteger,i4AsInteger,i5AsInteger,i6AsInteger
DimPWord1AsString
DimShTagAsBoolean,WinTagAsBoolean
Application.ScreenUpdating=False
WithActiveWorkbook
WinTag=.ProtectStructureOr.ProtectWindows
推荐阅读
- excel输入身份证号变成0解决方法知识科普
- EXCEL不同单元格需要输入密码后才能修改速来看看
- Excel-2010中自定义进行筛选并依次编号推荐阅读
- 利用Text函数在Excel-2013中建立顺序编号科普大全
- ie浏览器工具菜单在哪答案
- 在Excel-2010中控件的使用以及隐藏组合框2020开心玩
- Excel-2013表格中根据销售日期算出月份交易总金额升级必备
- 假期综合症 4妙招助你快速进入工作状态
- 怎么转换文件格式(文件格式转换)
- 快速提取出Excel-2010单元格括号内的文字信息读懂您就是高手