Skip i'r prif gynnwys

Sut i guddio colofnau ar sawl dalen mewn llyfr gwaith?

Yn Excel, gallwn guddio colofnau yn gyflym mewn un daflen waith, ond, a ydych erioed wedi ceisio cuddio colofnau ar draws sawl dalen ar unwaith? Fel rheol, efallai y byddwch chi'n ceisio dewis pob dalen a chymhwyso'r nodwedd Cuddio, ond ni fydd yn gweithio'n llwyddiannus. Yr erthygl hon, byddaf yn siarad am sut i guddio colofnau ar draws sawl taflen waith yn gyflym?

Cuddio colofnau ar sawl taflen waith mewn llyfr gwaith gyda chod VBA


swigen dde glas saeth Cuddio colofnau ar sawl taflen waith mewn llyfr gwaith gyda chod VBA

Gall y cod canlynol eich helpu i guddio colofnau penodol ar draws pob taflen waith ar unwaith, gwnewch fel hyn:

1. Daliwch i lawr y ALT + F11 allweddi i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Cliciwch Mewnosod > Modiwlau, a gludwch y cod canlynol yn y Modiwlau Ffenestr.

Cod VBA: Cuddio colofnau ar sawl dalen ar unwaith:

 Sub Hide_Columns()
'Updateby Extendoffice
    Dim iWs As Integer
    Dim sCol As String
    On Error Resume Next
    sCol = Application.InputBox("Input entire column,Eg A:A OR A:B", _
                                "Kutools for Excel", , , , , , 2)
    If sCol = "" Then
        MsgBox "Empty columns", vbInformation, "Kutools for Excel"
        Exit Sub
    End If
    For iWs = 1 To ThisWorkbook.Worksheets.Count
        ThisWorkbook.Sheets(iWs).Columns(sCol).Hidden = True
    Next iWs
    On Error GoTo 0
End Sub

3. Yna pwyswch F5 allwedd i redeg y cod hwn, ac mae blwch prydlon yn cael ei popio allan i'ch atgoffa i deipio'r colofnau rydych chi am eu cuddio ar draws pob taflen waith, gweler y screenshot:

colofnau cuddio doc pob dalen 1

4. Ac yna cliciwch OK botwm, mae eich colofnau penodedig wedi'u cuddio ym mhob taflen waith ar unwaith.

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 (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
How do I do this for rows?
This comment was minimized by the moderator on the site
And the VBA for unhiding the multiple columns as well.

Thank you in advance and God bless
This comment was minimized by the moderator on the site
Hi, Treb,
To show all the hidden columns from the whole workbook, please apply the below VBA code:
Sub ShowHiddenColumns()
Dim iWs As Integer
Dim sCol As String
On Error Resume Next
For iWs = 1 To ThisWorkbook.Worksheets.Count
ThisWorkbook.Sheets(iWs).Columns.Hidden = False
Next iWs
On Error GoTo 0
End Sub

Please try, hope it can help you!
This comment was minimized by the moderator on the site
I try to use this VBA code that you made to hide multiple columns in a multiple worksheets.. But How can I use it with out a message Box...

Please kindly help me to make a VBA that will hide the multiple columns in all worksheets at once with out having a lot of message box?..


I badly needed such a code.


Please help
This comment was minimized by the moderator on the site
Hello, Treb,
The popped out message box can help you to enter the hidden columns you need conveniently and dynamically.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations