Skip to main content

Conas pas a shocrúword chun bileog i bhfolach a chosaint i Excel?

Má tá leabhar oibre agat ina bhfuil roinnt bileoga oibre tábhachtacha i bhfolach, agus nach ligeann do dhaoine eile iad a cheilt. Anois, ní mór duit pas a shocrúword chun na bileoga oibre i bhfolach a chosaint go hiomlán, nuair a cheiltíonn úsáideoirí eile iad, caithfidh siad dul isteach sa phasword. An bhfuil aon bealaí chun déileáil leis an tasc seo go tapa agus go héasca i Excel?

Socraigh pasword chun bileoga folaithe a chosaint le feidhm VeryHidden

Socraigh pasword chun bileog i bhfolach a chosaint le cód VBA

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


Socraigh pasword chun bileoga folaithe a chosaint le feidhm VeryHidden

De ghnáth, is féidir leat an fheidhm VeryHidden a úsáid chun na bileoga oibre a cheilt ar dtús, agus ansin pas a shocrúword 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 dhéanamh an-i bhfolach, is féidir leat pas a shocrúword 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, ar deireadh, cuir isteach agus deimhnigh an pasword sa Pasword 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 Excel Leabhar Oibre Macra-chumasaithe formáid agus dún é chun an pas a dhéanamhword cosaint 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 na bileoga an-fholaithe a fheiceáil, iarrtar ort pas a chur isteachword. Féach an pictiúr:

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


Taispeántas: Socraigh pasword chun bileoga ceilte a chosaint


Socraigh pasword chun bileog i bhfolach a chosaint le cód VBA

Chun pas a shocrúword chun na bileoga i bhfolach a chosaint, is féidir liom labhairt freisin faoi chód VBA ar do shon.

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 pasword chun bileog 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 é an script an pasword a shocraigh tú don bhileog i bhfolach. Is féidir leat iad a athrú chuig do riachtanas.

4. Anois, nuair is mian leat an leathán i bhfolach a thaispeáint, popfaidh bosca pras amach chun ligean duit dul isteach sa phasword. Agus beidh an bosca leideanna seo le feiceáil gach uair, nuair a chliceálann tú chun an leathán i bhfolach a thaispeáint.

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


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

Más mian leat iolraí roghnaithe nó gach bileog oibre 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 i Excel. Ach, má tá Kutools for Excel, Lena Bileog Oibre a Chosaint fóntais, is féidir leat iad a chosaint le cliceáil amháin.

Kutools for Excel : le níos mó ná 300 handy Excel breiseáin, saor chun triail a bhaint as gan aon teorainn i 30 lá

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

1. Cliceáil Kutools Níos mó > 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 phasword agus athchlóscríobh 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á na bileoga oibre go léir sa leabhar oibre cosanta leis an pas céannaword.

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 Níos mó > Bileog Oibre Gan Chosaint, agus clóscríobh do phasword an chosaint a chealú.

 Íoslódáil agus triail saor in aisce Kutools for Excel Anois!


Earraí gaolmhara:

Conas bileoga oibre iolracha a chosaint ag an am céanna i Excel?

Conas pas a shocrúword chun an leabhar oibre a chosaint?

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

Uirlisí Táirgiúlachta Oifige is Fearr

Oifig Tacaíochta/Excel 2007-2021 agus 365 | Ar fáil i 44 Teanga | Éasca le Díshuiteáil go hiomlán

Gnéithe Coitianta: Aimsigh/Aibhsigh/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 go Words, Comhshó Airgeadra,...)   |   7 Cumaisc & Scoilt uirlisí (Sraitheanna Comhcheangail Casta, Cealla Scoilt,...)   |   ... agus eile

Kutools for Excel Tá breis is 300 gné ann, A chinntiú nach bhfuil uait ach cliceáil ar shiúl...

Supercharge Do Excel scileanna: Éifeachtúlacht Taithí Mar Riamh Roimhe Le Kutools for Excel  (Triail Iomlán 30-Lá Saor in Aisce)

cluaisín kte 201905

Ráthaíocht Neamhchoinníollach Airgid Ar Ais 60-LáLeigh Nios mo... Íoslódáil saor in aisce ... Ceannach ... 

Office Tab Tugann sé comhéadan Tabbed chuig Oifig, agus Déan do chuid Oibre i bhfad níos éasca

  • Cumasaigh eagarthóireacht agus léamh tabáilte isteach Word, Excel, Pointe cumhachta, 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éaduithe ar do tháirgiúlacht faoi 50%, agus laghdaítear na céadta cad a tharlaíonn nuair luiche duit gach lá! (Triail Iomlán 30-Lá Saor in Aisce)
Ráthaíocht Neamhchoinníollach Airgid Ar Ais 60-LáLeigh Nios mo... Íoslódáil saor in aisce ... Ceannach ... 
 
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