Skip i'r prif gynnwys

Sut i osod cyfrinair i amddiffyn taflen gudd yn Excel?

Os oes gennych lyfr gwaith sy'n cynnwys rhai taflenni gwaith cudd pwysig, a pheidiwch â gadael i eraill eu cuddio. Nawr, mae angen i chi osod cyfrinair i amddiffyn y taflenni gwaith cudd yn llwyr, pan fydd defnyddwyr eraill yn eu cuddio, rhaid iddynt nodi'r cyfrinair. A oes gennych unrhyw ffyrdd i ddelio â'r dasg hon yn gyflym ac yn hawdd yn Excel?

Gosodwch gyfrinair i amddiffyn taflenni cudd gyda swyddogaeth VeryHidden

Gosodwch gyfrinair i amddiffyn taflen gudd gyda chod VBA

Amddiffyn taflenni gwaith lluosog ar unwaith gyda Kutools ar gyfer Excel


Gosodwch gyfrinair i amddiffyn taflenni cudd gyda swyddogaeth VeryHidden

Fel rheol, gallwch ddefnyddio'r swyddogaeth VeryHidden i guddio'r taflenni gwaith yn gyntaf, ac yna gosod cyfrinair ar eu cyfer, gwnewch fel y camau canlynol:

1. Agorwch eich llyfr gwaith, a'i ddal Alt + F11allweddi i agor y Ffenestr Microsoft Visual Basic for Applications.

2. Yn y Ffenestr Microsoft Visual Basic for Applications, Cliciwch Gweld > Archwiliwr Prosiect ac Ffenestr Priodweddau to arddangos eu cwareli.

doc-protect-hidden-pages-01

3. Ac yna yn y Prosiect-VBAProject cwarel, dewiswch y daflen waith rydych chi am ei chuddio, ac yn y Eiddo cwarel, cliciwch y gwymplen o'r gweladwy adran i ddewis xlTaflenGudd opsiwn, gweler y screenshot:

doc-protect-hidden-pages-02

4. Ar ôl gwneud y daflen waith yn gudd iawn, gallwch chi osod cyfrinair i'w gwarchod. Yn y Ffenestr Microsoft Visual Basic for Applications, Cliciwch Mewnosod > Modiwlau i agor modiwl gwag, ac yna cliciwch offer > Priodweddau VBAProject, gweler y screenshot:

doc-protect-hidden-pages-03

5. Yna yn y popped allan Priodweddau Prosiect VBAProject blwch deialog, cliciwch Diogelu tab, ac yna gwirio Prosiect cloi i'w weld blwch, yn olaf, nodwch a chadarnhewch y cyfrinair yn y Cyfrinair i weld eiddo'r prosiect adran, gweler y screenshot:

doc-protect-hidden-pages-04

6. Yna cliciwch OK botwm i adael y dialog hwn, a chau'r Ffenestr Microsoft Visual Basic for Applications.

7. Cadwch y llyfr gwaith fel Llyfr Gwaith Macro-alluogedig Excel fformatio a'i gau i wneud i'r amddiffyniad cyfrinair ddod i rym.

doc-protect-hidden-pages-05

8. Y tro nesaf, pan fyddwch chi'n agor y llyfr gwaith hwn, ac eisiau gwneud i'r taflenni cudd fod yn weladwy, gofynnir i chi nodi cyfrinair. Gweler y screenshot:

doc-protect-hidden-pages-06


Demo: Gosodwch gyfrinair i amddiffyn taflenni cudd


Gosodwch gyfrinair i amddiffyn taflen gudd gyda chod VBA

I osod cyfrinair i amddiffyn y taflenni cudd, gallaf hefyd siarad am god VBA i chi.

1. Cuddiwch un daflen waith rydych chi am ei gwarchod.

2. Daliwch i lawr y ALT + F11 allweddi i agor y Ffenestr Microsoft Visual Basic for Applications.

3. Yna dewiswch Llyfr Gwaith hwn o'r chwith Archwiliwr Prosiect, cliciwch ddwywaith arno i agor y Modiwlau, ac yna copïo a gludo gan ddilyn y cod VBA i'r Modiwl gwag:

Cod VBA: Gosod cyfrinair i amddiffyn taflen gudd

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim xSheetName As String
xSheetName = "Sheet1"
If Application.ActiveSheet.Name = xSheetName Then
    Application.EnableEvents = False
    Application.ActiveSheet.Visible = False
    xTitleId = "KutoolsforExcel"
    response = Application.InputBox("Password", xTitleId, "", Type:=2)
    If response = "123456" Then
        Application.Sheets(xSheetName).Visible = True
        Application.Sheets(xSheetName).Select
    End If
End If
Application.Sheets(xSheetName).Visible = True
Application.EnableEvents = True
End Sub

doc-protect-hidden-pages-07

Nodyn: Yn y cod uchod, Sheet1 y xSheetName = "Taflen1" sgript yw'r enw taflen waith gudd yr ydych am ei amddiffyn, a 123456 yn y Os ymateb = "123456" Yna sgript yw'r cyfrinair a osodwyd gennych ar gyfer y ddalen gudd. Gallwch eu newid i'ch angen.

4. Nawr, pan fyddwch chi am ddangos y ddalen gudd, bydd blwch prydlon yn popio allan i adael i chi nodi'r cyfrinair. A bydd y blwch prydlon hwn yn ymddangos bob tro, pan gliciwch i ddangos y ddalen gudd.

doc-protect-hidden-pages-08


Amddiffyn taflenni gwaith lluosog ar unwaith gyda Kutools ar gyfer Excel

Os ydych chi am amddiffyn nifer o daflenni gwaith dethol neu bob un o lyfrau gwaith ar unwaith, fel rheol, mae angen i chi amddiffyn fesul un yn Excel. Ond, os oes gennych chi Kutools ar gyfer Excel, Gyda'i Taflen Waith Amddiffyn cyfleustodau, gallwch eu hamddiffyn gydag un clic.

Kutools ar gyfer Excel : gyda mwy na 300 o ychwanegiadau Excel defnyddiol, am ddim i geisio heb unrhyw gyfyngiad mewn 30 diwrnod

Ar ôl gosod Kutools ar gyfer Excel, gwnewch fel a ganlyn:

1. Cliciwch Kutools Byd Gwaith > Taflen Waith Amddiffyn, gweler y screenshot:

2. Yn y Taflen Waith Amddiffyn blwch deialog, mae'r holl daflenni gwaith yn y llyfr gwaith wedi'u rhestru yn y blwch rhestr, dewiswch y taflenni gwaith rydych chi am eu gwarchod. Gweler y screenshot:

doc-protect-hidden-pages-010

3. Ac yna cliciwch OK, yn y blwch deialog canlynol, nodwch eich cyfrinair a'i aildeipio eto, yna cliciwch OK, bydd blwch prydlon arall yn galw allan i'ch atgoffa faint o daflenni gwaith sydd wedi'u gwarchod.

doc-protect-hidden-pages-011

4. Yna cliciwch OK i gau'r dialogau, ac mae'r holl daflenni gwaith yn y llyfr gwaith wedi'u gwarchod gyda'r un cyfrinair.

Nodyn: Os ydych chi am amddiffyn yr holl daflenni gwaith ar unwaith, does ond angen i chi glicio Kutools Byd Gwaith > Taflen Waith Amddiffyn, a theipiwch eich cyfrinair i ganslo'r amddiffyniad.

 Dadlwythwch a threial am ddim Kutools ar gyfer Excel Nawr !


Erthyglau cysylltiedig:

Sut i amddiffyn nifer o daflenni gwaith ar unwaith yn Excel?

Sut i osod cyfrinair i amddiffyn y llyfr gwaith?

Sut i amddiffyn / cloi cod VBA yn Excel?

Offer Cynhyrchiant Swyddfa Gorau

🤖 Kutools AI Aide: Chwyldro dadansoddi data yn seiliedig ar: Cyflawniad Deallus   |  Cynhyrchu Cod  |  Creu Fformiwlâu Personol  |  Dadansoddi Data a Chynhyrchu Siartiau  |  Invoke Swyddogaethau Kutools...
Nodweddion Poblogaidd: Darganfod, Amlygu neu Adnabod Dyblygiadau   |  Dileu Rhesi Gwag   |  Cyfuno Colofnau neu Gelloedd heb Colli Data   |   Rownd heb Fformiwla ...
Super-edrych: VLookup Meini Prawf Lluosog    VLookup Gwerth Lluosog  |   VLookup Ar Draws Taflenni Lluosog   |   Edrych Niwlog ....
Rhestr gwympo Uwch: Creu Rhestr Gollwng yn Gyflym   |  Rhestr Gollwng Dibynnol   |  Rhestr Gollwng Aml-ddewis ....
Rheolwr Colofn: Ychwanegu Nifer Penodol o Golofnau  |  Symud Colofnau  |  Toglo Statws Gwelededd Colofnau Cudd  |  Cymharwch Ystodau a Cholofnau ...
Nodweddion dan Sylw: Ffocws ar y Grid   |  Golwg Dylunio   |   Bar Fformiwla Mawr    Rheolwr Llyfr Gwaith a Thaflen   |  Llyfrgell Adnoddau (Testun Auto)   |  Dewiswr Dyddiad   |  Cyfuno Taflenni Gwaith   |  Amgryptio/Dadgryptio Celloedd    Anfon E-byst trwy Restr   |  Hidlo Super   |   Hidlo Arbennig (hidlo mewn print trwm/italig/strikethrough...) ...
15 Set Offer Gorau12 Testun offer (Ychwanegu Testun, Dileu Cymeriadau,...)   |   50 + Siart Mathau (Siart Gantt,...)   |   40+ Ymarferol Fformiwlâu (Cyfrifwch oedran yn seiliedig ar ben-blwydd,...)   |   19 mewnosod offer (Mewnosod Cod QR, Mewnosod Llun o'r Llwybr,...)   |   12 Trosi offer (Rhifau i Eiriau, Trosi arian cyfred,...)   |   7 Uno a Hollti offer (Rhesi Cyfuno Uwch, Celloedd Hollt,...)   |   ... a mwy

Supercharge Eich Sgiliau Excel gyda Kutools ar gyfer Excel, a Phrofiad Effeithlonrwydd Fel Erioed Erioed. Kutools ar gyfer Excel Yn Cynnig Dros 300 o Nodweddion Uwch i Hybu Cynhyrchiant ac Arbed Amser.  Cliciwch Yma i Gael Y Nodwedd Sydd Ei Angen Y Mwyaf...

Disgrifiad


Mae Office Tab yn dod â rhyngwyneb Tabbed i Office, ac yn Gwneud Eich Gwaith yn Haws o lawer

  • Galluogi golygu a darllen tabbed yn Word, Excel, PowerPoint, Cyhoeddwr, Mynediad, Visio a Phrosiect.
  • Agor a chreu dogfennau lluosog mewn tabiau newydd o'r un ffenestr, yn hytrach nag mewn ffenestri newydd.
  • Yn cynyddu eich cynhyrchiant 50%, ac yn lleihau cannoedd o gliciau llygoden i chi bob dydd!
Comments (10)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
jak ktoś ukrył arkusz jak w opisanym pierwszym sposobie, a nie znamy hasła to jak odkryć arkusz skoro hasło do visual basic jest w ukrytym arkuszu?
This comment was minimized by the moderator on the site
Hello, ciekawa

Sorry, at present, there is no good way for canceling the protect of the hidden sheet if you forget the password.

But, you can apply the Uhide all hidden sheets feature of Kutools for Excel to unhide all the hidden sheets without any password.
https://www.extendoffice.com/images/stories/comments/comment-skyyang/doc-unhide-sheets.png
You can download Kutools for Excel and use it freely for 30 days.
Please have a try. Thank you!
This comment was minimized by the moderator on the site
This is elegant. IF the person opening the spreadsheet does not enable macros (i.e. VBA) what happens? Is the hidden sheet a sitting duck? Or is it quite impossible to find?
This comment was minimized by the moderator on the site
Hi, David,
If you open the workbook without enabling the macro, the hidden sheet is displayed as normal. In this case, I recommend you to apply the first method for solving this job.
Thank you!
This comment was minimized by the moderator on the site
Your code allows users to view the sheet as long as they hold the left mouse button while the mouse pointer is on the tab. Try this to keep sheet hidden until correct password is entered: If response = "123456" Then Application.Sheets(xSheetName).Visible = True Application.Sheets(xSheetName).Select Else Application.Sheets(xSheetName).Visible = False[/b][/b] End If End If Application.EnableEvents = True End Sub
This comment was minimized by the moderator on the site
I have a question about your password restricted worksheet code. You posted the following code which works....what I am looking for is code that will do this with multiple worksheets and multiple passwords within the same workbook. Is this possible? Private Sub Workbook_SheetActivate(ByVal Sh As Object) 'Update 20140925 Dim xSheetName As String xSheetName = "sheet1" If Application.ActiveSheet.Name = xSheetName Then Application.EnableEvents = False Application.ActiveSheet.Visible = False xTitleId = "KutoolsforExcel" response = Application.InputBox("Password", xTitleId, "", Type:=2) If response = "123456" Then Application.Sheets(xSheetName).Visible = True Application.Sheets(xSheetName).Select End If End If Application.Sheets(xSheetName).Visible = True Application.EnableEvents = True End Sub
This comment was minimized by the moderator on the site
Found a solution yet?

I am having the same problem
This comment was minimized by the moderator on the site
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim aSheetName As String
Dim bSheetName As String
Dim cSheetName As String
aSheetName = "sheet1"
bSheetName = "sheet2"
cSheetName = "sheet3"

If Application.ActiveSheet.Name = aSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "123" Then
Application.Sheets(aSheetName).Visible = True
Application.Sheets(aSheetName).Select
Else
Application.Sheets(aSheetName).Visible = False
End If
End If
Application.EnableEvents = True

If Application.ActiveSheet.Name = bSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "456" Then
Application.Sheets(bSheetName).Visible = True
Application.Sheets(bSheetName).Select
Else
Application.Sheets(bSheetName).Visible = False
End If
End If
Application.EnableEvents = True

If Application.ActiveSheet.Name = cSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "789" Then
Application.Sheets(cSheetName).Visible = True
Application.Sheets(cSheetName).Select
Else
Application.Sheets(cSheetName).Visible = False
End If
End If
Application.EnableEvents = True

End Sub
This comment was minimized by the moderator on the site
Thanks for the code, just have one question. When you open the sheet you are asked for question, then you enter it and the sheet is visible, but when you jump to next sheet and try to re-open previous sheet, you are asked for the same password again everytime. My question is can you bypass that and make excel ask for password once?
This comment was minimized by the moderator on the site
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim xSheetName As String
aSheetName = "sheet1"
bSheetName = "sheet2"
cSheetName = "sheet3"

If Application.ActiveSheet.Name = aSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "1234" Then
Application.Sheets(aSheetName).Visible = True
Application.Sheets(aSheetName).Select
Else
Application.Sheets(aSheetName).Visible = False
End If
End If
Application.EnableEvents = True

If Application.ActiveSheet.Name = bSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "2345" Then
Application.Sheets(bSheetName).Visible = True
Application.Sheets(bSheetName).Select
Else
Application.Sheets(bSheetName).Visible = False
End If
End If
Application.EnableEvents = True

If Application.ActiveSheet.Name = cSheetName Then
Application.EnableEvents = False
Application.ActiveSheet.Visible = False
xTitleId = "KutoolsforExcel"
response = Application.InputBox("Password", xTitleId, "", Type:=2)
If response = "3456" Then
Application.Sheets(cSheetName).Visible = True
Application.Sheets(cSheetName).Select
Else
Application.Sheets(cSheetName).Visible = False
End If
End If
Application.EnableEvents = True

End Sub
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations