Hoppa till huvudinnehåll

Hur tillåter stavningskontroll i ett skyddat kalkylblad i Excel?

Som standard inaktiveras stavningsfunktionen efter att du har skyddat kalkylbladet som visas nedan. Hur tillåter stavningskontroll i ett skyddat kalkylblad i Excel? Den här artikeln kan hjälpa dig.

Tillåt stavningskontroll i ett skyddat kalkylblad med VBA-kod


Tillåt stavningskontroll i ett skyddat kalkylblad med VBA-kod

Kör nedanstående VBA-kod för att aktivera stavningskontrollfunktionen i ett skyddat kalkylblad.

1. tryck på andra + F11 samtidigt för att öppna Microsoft Visual Basic för applikationer fönster.

2. I Microsoft Visual Basic för applikationer fönstret klickar Insert > Modulerna. Kopiera sedan och klistra in nedanstående VBA-kod i modulfönstret. Se skärmdump:

VBA-kod: Tillåt stavningskontroll i ett skyddat kalkylblad

Sub ProtectSheetCheckSpellCheck()
'Update by Extendoffice 2018/11/2
Dim xRg As Range
On Error Resume Next
Application.ScreenUpdating = False
    With ActiveSheet
        .Unprotect ("123")
        Set xRg = .UsedRange
        xRg.CheckSpelling
        .Protect ("123")
    End With
Application.ScreenUpdating = True
End Sub

Anmärkningar: I koden är siffran "123" lösenordet för det skyddade kalkylbladet du har skapat för det. Ändra det efter behov.

3. Välj den cell du behöver för att aktivera stavningskontrollen i det skyddade kalkylbladet och kör sedan VBA-koden genom att trycka på F5-tangenten.

Sedan dyker dialogrutan Stavning upp i det skyddade kalkylbladet som visas nedan.


Relaterade artiklar:

Bästa kontorsproduktivitetsverktyg

🤖 Kutools AI Aide: Revolutionera dataanalys baserat på: Intelligent utförande   |  Generera kod  |  Skapa anpassade formler  |  Analysera data och generera diagram  |  Anropa Kutools funktioner.
Populära funktioner: Hitta, markera eller identifiera dubbletter   |  Ta bort tomma rader   |  Kombinera kolumner eller celler utan att förlora data   |   Rund utan formel ...
Superuppslag: Flera kriterier VLookup    VLookup med flera värden  |   VSök över flera ark   |   Fuzzy Lookup ....
Avancerad rullgardinslista: Skapa snabbt en rullgardinslista   |  Beroende rullgardinslista   |  Flervals-rullgardinslista ....
Kolumnhanterare: Lägg till ett specifikt antal kolumner  |  Flytta kolumner  |  Växla synlighetsstatus för dolda kolumner  |  Jämför intervall och kolumner ...
Utvalda funktioner: Rutnätsfokus   |  Designvy   |   Stor formelbar    Arbetsbok & Bladhanterare   |  Resursbibliotek (Automatisk text)   |  Datumväljare   |  Kombinera arbetsblad   |  Kryptera/Dekryptera celler    Skicka e-postmeddelanden efter lista   |  Superfilter   |   Specialfilter (filtrera fet/kursiv/genomstruken...) ...
Topp 15 verktygssatser12 text verktyg (lägga till text, Ta bort tecken, ...)   |   50+ Diagram Typer (Gantt Chart, ...)   |   40+ Praktiskt Formler (Beräkna ålder baserat på födelsedag, ...)   |   19 Införande verktyg (Infoga QR-kod, Infoga bild från sökväg, ...)   |   12 Konvertering verktyg (Siffror till ord, Valutaväxling, ...)   |   7 Slå ihop och dela verktyg (Avancerade kombinera rader, Dela celler, ...)   |   ... och mer

Uppgradera dina Excel-färdigheter med Kutools för Excel och upplev effektivitet som aldrig förr. Kutools för Excel erbjuder över 300 avancerade funktioner för att öka produktiviteten och spara tid.  Klicka här för att få den funktion du behöver mest...

Beskrivning


Fliken Office ger ett flikgränssnitt till Office och gör ditt arbete mycket enklare

  • Aktivera flikredigering och läsning i Word, Excel, PowerPoint, Publisher, Access, Visio och Project.
  • Öppna och skapa flera dokument i nya flikar i samma fönster, snarare än i nya fönster.
  • Ökar din produktivitet med 50 % och minskar hundratals musklick för dig varje dag!
Comments (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
HI thank you for this information it works well, but it gives away the password to anyone that uses it? is there a way to hide it?
This comment was minimized by the moderator on the site
Hi Bobbie Gower,
You can follow the following tutorial to hide the corresponding VBA Module to prevent others from viewing the password.
How to Protect and Hide Excel Macros
This comment was minimized by the moderator on the site
Hello!
スペルチェックができるようになりましたが、選択した範囲以外も引っかかってしまいます。選択した部分のみチェックしたい場合には、どうすればいいですか?
すみません、随分前にアップされたようですが、もしまだアクセスされているようでしたら、ご返信いただければ幸いです。
よろしくお願いいたします。
This comment was minimized by the moderator on the site
Hi korori,
I don't quite understand what you mean. The code works on the selected cells. If you want to check the spellings in a range, just select the range and run the code. Then the Spelling dialog box will pop up.
This comment was minimized by the moderator on the site
I'm trying to get a protected worksheet intended to be a form to have those fields that are entered by the form user to get spell check. This seems like you have to run VBA just to check one cell?
This comment was minimized by the moderator on the site
Hi,
The code has been updated with the problem solved, please have a try. Thank you for your comment.
This comment was minimized by the moderator on the site
Thanks for this. It has worked well, except that it changes my sheet protection settings every time I run it. I have my sheet protected, but set to allow users to format cells, columns, and rows; but after running this code, the protection is set back to the default. How can I retain my settings?
This comment was minimized by the moderator on the site
You have to modify the .protect code by adding allow the criteria you want.
Worksheets("Sheet1").Protect,<span style="letter-spacing: 0.2px; color: inherit; font-family: inherit; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">:=False, AllowInsertingColumns:=False, AllowInsertingRows:=False,</span><span style="letter-spacing: 0.2px; color: inherit; font-family: inherit; font-style: inherit; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">:=False, AllowFiltering:=False, </span>
This comment was minimized by the moderator on the site
So please help my with the correct code if possible, cant get it to work with AllowInsertingRows
.Protect ("Welkom") and then?????? bit of a nob tot this
my worksheet (tabs) is called for example P&A or BIOP
This comment was minimized by the moderator on the site
Hi, thanks for these steps, but please help!! I'm not getting the spell check window when pressing F5, instead I get a GoTo window listing all the names of the defined data ranges in my workbook. Thanks JulieD
This comment was minimized by the moderator on the site
Hi JulieD,
It's my mistake of the description in step 3. After selecting the cell, you need to go back to the Microsoft Visual Basic for Applications window and then press the F5 key to run the code. Sorry for the mistake and thanks for your comment.
This comment was minimized by the moderator on the site
So please help my with the correct code if possible, cant get it to work with AllowInsertingRows
.Protect ("Welkom") and then?????? bit of a nob tot this
my worksheet (tabs) is called for example P&A or BIOP
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations