一个EXCEL文档中的几个工作表,可以分别加密码吗?

2024-12-20 08:03:55
推荐回答(5个)
回答1:

一下是个实例,参考修改后你可以实现Sub 登录()
Dim a As Variant
Dim x As Variant
x = InputBox(Prompt:="输入密码")
With Worksheets("次梁锚固")
.Range("A1") = x
a = .Range("C1")
If a = False Then
Application.DisplayFormulaBar = True
Application.CommandBars("Standard").Visible = True
Application.CommandBars("Formatting").Visible = True
Application.CommandBars("Protection").Visible = True
Application.CommandBars("Drawing").Visible = True
Application.CommandBars("Picture").Visible = True
Application.CommandBars("Borders").Visible = True
Application.CommandBars("符号栏").Visible = True
Application.CommandBars("Forms").Visible = True
Application.CommandBars("Visual Basic").Visible = True
Application.Sheets("锚固").Visible = True
Application.Sheets("钢筋数量分类汇总").Visible = True
Application.Sheets("楼层标高").Visible = True
Application.Sheets("主窗口").Visible = True
Application.Sheets("重量分类汇总").Visible = True
Application.Sheets("重量汇总").Visible = True
Application.Sheets("零工").Visible = True
Application.Sheets("工作页").Visible = True
Application.Sheets("打印页").Visible = True
Application.Sheets("箍筋汇总").Visible = True
Application.Sheets("拉筋汇总").Visible = True
Application.Sheets("参数").Visible = True
Application.Sheets("计划").Visible = True
Application.Sheets("加析器").Visible = True
Application.Sheets("内箍").Visible = True
Application.Sheets("图形").Visible = True
Application.Sheets("积水坑").Visible = True
Application.Sheets("缩尺").Visible = True
Application.Sheets("用工").Visible = True
Application.Sheets("砼配比").Visible = True
Application.Sheets("数据提取").Visible = True
Application.Sheets("Attributes").Visible = True
Application.Sheets("输出页").Visible = True
Application.Sheets("yx").Visible = True
Application.Sheets("YXG").Visible = True
Application.Sheets("桩").Visible = True
ActiveSheet.shapes("Button 9").Select
Selection.Characters.text = "密码正确,数据已加载,欢迎登录本系统!"
With Selection.Characters(Start:=1, Length:=10).Font
.Name = "宋体"
.FontStyle = "常规"
.Size = 24
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
Call 系统说明
Dim PauseTime, Start, Finish, TotalTime
If (MsgBox("系统说明已加载,你有2分钟的阅读时间", 4)) = vbYes Then
PauseTime = 120
Start = Timer
Do While Timer < Start + PauseTime
DoEvents
Loop
Finish = Timer
TotalTime = Finish - Start
MsgBox "时间已到时,系统清除说明!"
Sheets("主窗口").Select
Range("A12:A1000").Select
Range("A12:A1000") = ""
Else
End
End If
End With
End If
If a = True Then
Application.DisplayFormulaBar = False
Application.CommandBars("Standard").Visible = False
Application.CommandBars("Formatting").Visible = False
Application.CommandBars("Protection").Visible = False
Application.CommandBars("Drawing").Visible = False
Application.CommandBars("Picture").Visible = False
Application.CommandBars("Borders").Visible = False
Application.CommandBars("符号栏").Visible = False
Application.CommandBars("Forms").Visible = False
Application.CommandBars("Visual Basic").Visible = False
Application.Sheets("锚固").Visible = False
Application.Sheets("钢筋数量分类汇总").Visible = False
Application.Sheets("楼层标高").Visible = False
Application.Sheets("主窗口").Visible = True
Application.Sheets("重量分类汇总").Visible = False
Application.Sheets("重量汇总").Visible = False
Application.Sheets("零工").Visible = False
Application.Sheets("工作页").Visible = False
Application.Sheets("打印页").Visible = False
Application.Sheets("箍筋汇总").Visible = False
Application.Sheets("拉筋汇总").Visible = False
Application.Sheets("参数").Visible = False
Application.Sheets("计划").Visible = False
Application.Sheets("加析器").Visible = False
Application.Sheets("内箍").Visible = False
Application.Sheets("图形").Visible = False
Application.Sheets("积水坑").Visible = False
Application.Sheets("缩尺").Visible = False
Application.Sheets("用工").Visible = False
Application.Sheets("砼配比").Visible = False
Application.Sheets("数据提取").Visible = False
Application.Sheets("Attributes").Visible = False
Application.Sheets("输出页").Visible = False
Application.Sheets("yx").Visible = False
Application.Sheets("YXG").Visible = False
Application.Sheets("桩").Visible = False
ActiveSheet.shapes("Button 9").Select
Selection.Characters.text = "系统未激活,请单击此按钮,再次登录并加载数据与设置!"
With Selection.Characters(Start:=1, Length:=10).Font
.Name = "宋体"
.FontStyle = "常规"
.Size = 24
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
Sheets("主窗口").Select
Range("A12:A1000").Select
Range("A12:A1000") = ""
ActiveWorkbook.Save
ActiveWindow.Close
End With
End If
End With
End Sub

回答2:

默认是3个,可以根据个人需要设置数量,可以给整个工作簿加密,不可给单个工作表加密。

回答3:

加密本来就是按工作表来进行的。不过这种加密是不让修改,不是不让看如果你想不让看的话,就设置该表隐藏并设置隐藏密码。但这样2007版 后才有这个功能

回答4:

默认的是3个,最多可以建立255个,不可以分别加密,只能给这个EXCEL文档加密

回答5:

有3种方法:

1 用系统自带的EFS加密,但要注意备份加密证书,另外在加密帐号下是看不到加密效果的。

2 用winrar的压缩加密,但速度慢,操作麻烦。

3 用超级加密3000加密文件,超级加密3000采用先进的加密算法,使你的文件加密后,真正的达到超高的加密强度,让你的加密文件无懈可击,没有密码无法解密。

您可以根据自己的实际需求选择一款属于自己的文件加密方法。