Skip to main content

Conas pasfhocal a shocrú chun an bhileog i bhfolach a chosaint in Excel?

Má tá leabhar oibre agat ina bhfuil roinnt bileoga oibre ceilte tábhachtacha, agus ná lig do dhaoine eile iad a chur ar neamhní. Anois, ní mór duit pasfhocal a shocrú chun na bileoga oibre i bhfolach a chosaint go hiomlán, nuair a dhéanann úsáideoirí eile iad a chur ar neamhní, caithfidh siad an focal faire a iontráil. An bhfuil aon bhealaí agat chun déileáil leis an tasc seo go tapa agus go héasca in Excel?

Socraigh pasfhocal chun bileoga i bhfolach a bhfuil feidhm VeryHidden acu a chosaint

Socraigh pasfhocal chun an bhileog i bhfolach a chosaint le cód VBA

Cosain iliomad bileoga oibre ag an am céanna le Kutools for Excel


Socraigh pasfhocal chun bileoga i bhfolach a bhfuil feidhm VeryHidden acu a chosaint

De ghnáth, is féidir leat an fheidhm VeryHidden a úsáid chun na bileoga oibre a cheilt ar dtús, agus ansin pasfhocal a shocrú dóibh, déan na céimeanna seo a leanas le do thoil:

1. Oscail do leabhar oibre, agus coinnigh Alt + F11eochracha a oscailt Fuinneog Microsoft Visual Basic for Applications.

2. Sa an Fuinneog Microsoft Visual Basic for Applications, Cliceáil Amharc > Explorer Tionscadail agus Fuinneog Airíonna to a gcuid painéil a thaispeáint.

leatháin doc-protect-hidden-hidden-01

3. Agus ansin sa Tionscadal-VBAProject pána, roghnaigh an bhileog oibre a theastaíonn uait a cheilt, agus sa Airíonna pána, cliceáil ar an liosta anuas ón Infheicthe alt le roghnú xlBileogAn-I bhfolach rogha, féach an scáileán:

leatháin doc-protect-hidden-hidden-02

4. Tar éis duit an bhileog oibre a chur i bhfolach go mór, is féidir leat pasfhocal a shocrú chun í a chosaint. Sa Fuinneog Microsoft Visual Basic for Applications, Cliceáil Ionsáigh > Modúil chun modúl folamh a oscailt, agus ansin cliceáil uirlisí > Airíonna VBAProject, féach ar an scáileán:

leatháin doc-protect-hidden-hidden-03

5. Ansin sa popped amach Airíonna VBAProject-Project dialóg, cliceáil Cosaint tab, agus ansin seiceáil Tionscadal faoi ghlas le breathnú air bosca, faoi dheireadh, cuir isteach agus dearbhaigh an focal faire sa Pasfhocal chun airíonna an tionscadail a fheiceáil alt, féach an pictiúr:

leatháin doc-protect-hidden-hidden-04

6. Ansin cliceáil OK cnaipe chun an dialóg seo a fhágáil, agus an Fuinneog Microsoft Visual Basic for Applications.

7. Sábháil an leabhar oibre mar Leabhar Oibre Macra-Chumasaithe Excel formáidiú agus dún é chun go mbeidh an chosaint pasfhocail i bhfeidhm.

leatháin doc-protect-hidden-hidden-05

8. An chéad uair eile, nuair a osclaíonn tú an leabhar oibre seo, agus tú ag iarraidh go mbeidh na bileoga an-folaithe le feiceáil, iarrtar ort pasfhocal a iontráil. Féach an pictiúr:

leatháin doc-protect-hidden-hidden-06


Taispeántas: Socraigh pasfhocal chun bileoga i bhfolach a chosaint


Socraigh pasfhocal chun an bhileog i bhfolach a chosaint le cód VBA

Chun pasfhocal a shocrú chun na bileoga ceilte a chosaint, is féidir liom labhairt faoi chód VBA duitse freisin.

1. Folaigh bileog oibre amháin a theastaíonn uait a chosaint.

2. Coinnigh síos an ALT + F11 eochracha a oscailt Fuinneog Microsoft Visual Basic for Applications.

3. Ansin roghnaigh An Leabhar Oibre seo ón taobh clé Explorer Tionscadail, cliceáil faoi dhó air chun an Modúil, agus ansin cóipeáil agus greamaigh an cód VBA seo a leanas sa Mhodúl bán:

Cód VBA: Socraigh pasfhocal chun an bhileog i bhfolach a chosaint

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

leatháin doc-protect-hidden-hidden-07

nótaí: Sa chód thuas, Sheet1 de na xSheetName = "Bileog1" Is é script ainm an bhileog oibre i bhfolach a theastaíonn uait a chosaint, agus 123456 sa Má tá freagra = "123456" Ansin Is é script an focal faire a shocraigh tú don bhileog i bhfolach. Is féidir leat iad a athrú de réir do riachtanas.

4. Anois, nuair is mian leat an bhileog i bhfolach a thaispeáint, tiocfaidh bosca pras amach chun ligean duit an focal faire a iontráil. Agus beidh an bosca pras seo le feiceáil gach uair, nuair a chliceálann tú chun an bhileog i bhfolach a thaispeáint.

leatháin doc-protect-hidden-hidden-08


Cosain iliomad bileoga oibre ag an am céanna le Kutools for Excel

Más mian leat an iliomad bileog oibre roghnaithe nó gach ceann de leabhar oibre a chosaint ag an am céanna, de ghnáth, ní mór duit ceann ar cheann a chosaint de láimh in Excel. Ach, má tá Kutools le haghaidh Excel, Lena Bileog Oibre a Chosaint fóntais, is féidir leat iad a chosaint le cliceáil amháin.

Kutools le haghaidh Excel : le níos mó ná 300 breiseán áisiúil Excel, saor in aisce le triail gan aon teorannú i 30 lá

Tar éis a shuiteáil Kutools le haghaidh Excel, déan mar a leanas le do thoil:

1. Cliceáil Kutools Plus > Bileog Oibre a Chosaint, féach ar an scáileán:

2. Sa an Bileog Oibre a Chosaint bosca dialóige, liostaítear gach bileog oibre sa leabhar oibre sa bhosca liosta, roghnaigh na bileoga oibre a theastaíonn uait a chosaint. Féach an pictiúr:

leatháin doc-protect-hidden-hidden-010

3. Agus ansin cliceáil OK, sa bhosca dialóige seo a leanas, cuir isteach do phasfhocal agus athúsáid arís é, ansin cliceáil OK, tiocfaidh bosca pras eile amach le cur i gcuimhne duit cé mhéad bileog oibre atá cosanta.

leatháin doc-protect-hidden-hidden-011

4. Ansin cliceáil OK chun na dialóga a dhúnadh, agus tá gach ceann de na bileoga oibre sa leabhar oibre cosanta leis an bhfocal faire céanna.

Nóta: Más mian leat gach ceann de na bileoga oibre a chosaint ag an am céanna, ní gá duit ach cliceáil Kutools Plus > Bileog Oibre Gan Chosaint, agus clóscríobh do phasfhocal chun an chosaint a chealú.

 Íoslódáil agus triail saor in aisce Kutools le haghaidh Excel Now!


Earraí gaolmhara:

Conas iliomad bileoga oibre a chosaint ag an am céanna in Excel?

Conas pasfhocal a shocrú chun an leabhar oibre a chosaint?

Conas cód VBA a chosaint / ghlasáil in Excel?

Uirlisí Táirgiúlachta Oifige is Fearr

🤖 Kutools AI Aide: anailís sonraí a réabhlóidiú bunaithe ar: Forghníomhú Chliste   |  Gin Cód  |  Cruthaigh Foirmlí Saincheaptha  |  Anailís a dhéanamh ar Sonraí agus Cairteacha a Ghin  |  Feidhmeanna Kutools a agairt...
Gnéithe Coitianta: Faigh, Aibhsigh nó Aithnigh Dúblaigh   |  Scrios Sraitheanna Bána   |  Comhcheangail Colúin nó Cealla gan Sonraí a Chailleadh   |   Babhta gan Foirmle ...
Cuardaigh Super: Ilchritéir VLookup    VLookup Illuachanna  |   VLookup Trasna Ilbhileoga   |   Amharc doiléir ....
Liosta anuas Casta: Go tapa Cruthaigh Liosta Anuas   |  Liosta anuas Cleithiúnach   |  Liosta Buail Isteach Ilroghnacha ....
Bainisteoir Colún: Cuir Líon Sonrach Colún leis  |  Colúin Bog  |  Scoránaigh Stádas Infheictheachta na gColún Ceilte  |  Déan comparáid idir Raonta & Colúin ...
Gnéithe Réadmhaoin: Fócas Eangaí   |  Amharc Dearaidh   |   Barra Mór na Foirmle    Leabhar Oibre & Bainisteoir Bileog   |  Leabharlann Acmhainní (Uaththéacs)   |  Piocálaí Dáta   |  Comhcheangail Bileoga Oibre   |  Criptigh/Díchriptigh Cealla    Seol Ríomhphost trí Liosta   |  Scagaire Super   |   Scagaire Speisialta (scagaire trom/iodálach/stailc tríd...) ...
Barr 15 Uirlisí12 Téacs uirlisí (Cuir Téacs, Bain Carachtair,...)   |   50 + Cairt cineálacha (Cairt Gantt,...)   |   40+ Praiticiúil Foirmlí (Ríomh aois bunaithe ar lá breithe,...)   |   19 Insertion uirlisí (Cuir isteach Cód QR, Ionsáigh Pictiúr ón gCosán,...)   |   12 Tiontú uirlisí (Uimhreacha le Focail, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Supercharge Do Scileanna Excel le Kutools le haghaidh Excel, agus Éifeachtúlacht Taithí Cosúil Ná Roimhe. Kutools le haghaidh Excel Tairiscintí Níos mó ná 300 Ardghnéithe chun Táirgiúlacht a Treisiú agus Sábháil Am.  Cliceáil anseo chun an ghné is mó a theastaíonn uait a fháil ...

Tuairisc


Tugann Tab Oifige comhéadan Tabbed chuig Office, agus Déan Do Obair i bhfad Níos Éasca

  • Cumasaigh eagarthóireacht agus léamh tabbed i Word, Excel, PowerPoint, Foilsitheoir, Rochtain, Visio agus Tionscadal.
  • Oscail agus cruthaigh cáipéisí iolracha i gcluaisíní nua den fhuinneog chéanna, seachas i bhfuinneoga nua.
  • Méadaíonn do tháirgiúlacht 50%, agus laghdaíonn sé na céadta cad a tharlaíonn nuair luch duit gach lá!
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