Skip i'r prif gynnwys

Sut i guddio rhesi yn seiliedig ar werth celloedd yn Excel?

Awdur: Haul Wedi'i Addasu Diwethaf: 2020-04-26

Gan dybio bod gennych chi ystod o ddata, a'ch bod chi am guddio'r rhesi yn seiliedig ar werth colofn, er enghraifft, os yw gwerth cell y golofn yn llai na 3000, yna cuddiwch res y gell fel islaw'r screenshot a ddangosir.


Yn Excel, gallwch ddefnyddio'r swyddogaeth Hidlo i hidlo a chuddio'r rhesi yn seiliedig ar werth celloedd.

1. Dewiswch y data rydych chi am ei hidlo allan, a chlicio Dyddiad > Hidlo. Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 2

2. Yna cliciwch ar y saeth i lawr i arddangos y gwymplen hidlo, a chlicio Hidlau Rhif (neu Hidlau Testun) > Yn fwy na (gallwch ddewis maen prawf arall sydd ei angen arnoch o'r is-raglen). Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 3

3. Yn y dialog popio, teipiwch y maen prawf yn y blwch testun nesaf ato yn fwy na. Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 4

4. Cliciwch OK. Nawr dangosir yr unig ddata sy'n fwy na 3000, ac mae'r rhesi y mae eu data yn llai na 3000 wedi'u cuddio.

rhesi cuddio doc yn seiliedig ar werth 5


Ar ben hynny, os oes gennych ddiddordeb mewn cod VBA, yma gallaf gyflwyno cod VBA i guddio rhesi yn seiliedig ar werth celloedd.

1. Gwasgwch Alt + F11 allweddi i alluogi Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yna cliciwch Mewnosod > Modiwlau i agor newydd Modiwlau ffenestr, a'i gludo o dan god VBA i mewn iddo.

VBA: Cuddio rhesi yn seiliedig ar werth celloedd.

Sub HideRow()
'Updateby20150618
Dim Rng As Range
Dim WorkRng As Range
Dim xNumber As Integer
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xNumber = Application.InputBox("Number", xTitleId, "", Type:=1)
For Each Rng In WorkRng
    Rng.EntireRow.Hidden = Rng.Value < xNumber
Next
End Sub

3. Yna pwyswch F5 allwedd i redeg y VBA, yna dewiswch yr ystod ddata rydych chi am guddio rhesi i'r ymgom popping (ac eithrio penawdau). Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 6

4. Cliciwch OK, a theipiwch rif y maen prawf yn yr ail ymgom. Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 7

5. Cliciwch OK. Nawr mae'r rhesi y mae eu data yn llai na 3000 wedi'u cuddio.

Tip: Os ydych chi am guddio rhesi sy'n fwy na 3000, dim ond newid Rng.EntireRow.Hidden = Rng.Value <xNumber i Rng.EntireRow.Hidden = Rng.Value> xNumber, neu os ydych chi am guddio rhesi y mae eu data yn hafal i 3000, newidiwch i Rng.EntireRow.Hidden = Rng.Value = xNumber.


Dewiswch gelloedd yn gyflym yn seiliedig ar feini prawf yn Excel

Gyda Kutools ar gyfer Excel's Dewiswch Gelloedd Penodol, gallwch ddewis celloedd yn seiliedig ar un neu ddau o feini prawf unwaith y tro. 
doc dewis celloedd penodol
 
Kutools ar gyfer Excel: gyda mwy na 300 o ychwanegion Excel defnyddiol, am ddim i geisio heb unrhyw gyfyngiad mewn 30 diwrnod.

OS nad ydych yn hoffi galluogi swyddogaeth Hidlo, nac i VBA, dyma fi'n cyflwyno teclyn defnyddiol i chi - Dewiswch Gelloedd Penodol of Kutools ar gyfer Excel i ddewis rhesi cyfan yn gyflym yn seiliedig ar werth celloedd, yna gallwch eu cuddio.

Kutools ar gyfer Excel, gyda mwy na 300 swyddogaethau defnyddiol, yn gwneud eich swyddi yn haws. 

Ar ôl gosod am ddim Kutools ar gyfer Excel, gwnewch fel isod:

Awgrym. Os ydych chi am gael treial am ddim o'r swyddogaeth Testun Detholiad, ewch i roi cynnig am ddim Kutools ar gyfer Excel yn gyntaf, ac yna ewch i gymhwyso'r llawdriniaeth yn ôl y camau uchod.

1. Dewiswch yr ystod ddata a chlicio Kutools > dewiswch > Dewiswch Gelloedd Penodol. Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 14

2. Yn y Dewiswch Gelloedd Penodol deialog, gwirio Rhes gyfan dan Math o ddewis adran, yna dewiswch y maen prawf rydych chi ei angen Math penodol rhestrwch, yna teipiwch y rhif neu'r testun yn y blwch testun. Gweler y screenshot:

rhesi cuddio doc yn seiliedig ar werth 9

3. Cliciwch Ok > OK i gau deialogau. Nawr mae'r rhesi y mae eu data yn llai na 3000 yn cael eu dewis, a does ond angen i chi glicio ar dde ym mhennawd y rhes i ddangos y ddewislen cyd-destun, a chlicio Cuddio. Gweler y screenshot:
rhesi cuddio doc yn seiliedig ar werth 10

Nawr mae'r rhesi y mae eu data yn llai na 3000 wedi'u cuddio.

rhesi cuddio doc yn seiliedig ar werth 11

Tip:

1. Os ydych chi am guddio rhesi sy'n cynnwys gwerth penodol, gallwch ddewis Yn cynnwys a theipiwch y gwerth penodol yn y blwch testun.

rhesi cuddio doc yn seiliedig ar werth 12

2. Os ydych chi am guddio rhesi sy'n cynnwys gwerth sy'n fwy na ond llai na gwerthoedd, gallwch ddewis Yn fwy na ac Llai na, yna teipiwch y gwerthoedd yn y ddau flwch, a'u gwirio Ac.

rhesi cuddio doc yn seiliedig ar werth 13

Gyda Kutools ar gyfer Excel's Dewiswch Gelloedd Penodol cyfleustodau, gallwch nodi lleoliad celloedd penodol, dewis rhesi neu golofnau cyfan yn seiliedig ar werth celloedd ac ati. Cliciwch yma i wybod mwy am y cyfleustodau hwn.

Kutools ar gyfer Excel: 300+ swyddogaethau y mae'n rhaid i chi eu cael yn Excel, Treial am ddim 30 diwrnod o'r fan hon.

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 (17)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Yes, "Entire Row" is selected.
This comment was minimized by the moderator on the site
All rows remain selected without using Kutools. As soon as I use Kutools and select header row, all other rows but the header row de-select.
This comment was minimized by the moderator on the site
Are you sure check the Entire row option in the dialog? If you check cell option, the selected cells will be unselected when you right click at one row.
https://www.extendoffice.com/images/stories/comments/sun-comment/doc-select-specific-cell-1.png
This comment was minimized by the moderator on the site
Hi - I'm using a newer Lenovo PC with Windows 10 Professional and Microsoft 365 Apps for business. Excel Version 2210 (Build 15726.20202 Click-to-Run).
This comment was minimized by the moderator on the site
I have tried the operation in the same version with you, there is no any problem. Could you try to manually select several rows (without using Kutools for Excel), then right click at one row header, see all rows are remained selecting?
This comment was minimized by the moderator on the site
I have done exactly what you've demonstrated. However, when I right-click on the row header, all other rows become de-selected and only that one row remains selected to be hidden or deleted. No matter what I do, the other rows do not stay selected when right-clicking on the header. I'm at a loss to know what to do now.
This comment was minimized by the moderator on the site
I am so sorry for that. Could you tell me what Excel version and system you use?
This comment was minimized by the moderator on the site
Hello,

That is exactly what I've been doing, however, it only hides the row on which I have clicked the row header. All other selected rows remain unhidden, and are deselected at the same time. I will try it again following your gif exactly. Thanks for your reply.
This comment was minimized by the moderator on the site
I'm using Kutools to select entire rows based on a value, and it does select all the rows with that value. However, when I right-click on the row header and click on "Hide" in the menu, only that row is hidden and the rest that were selected become de-selected. It appears I still have to hide each row one at a time. What am I doing wrong?
This comment was minimized by the moderator on the site
Hi, Rochelley, I think there may be some wrong when you right-click at the row header. After the rows which match your condition are selecetd after applying the feature, right click at one row header of them, note that other rows are kept selected, then choose hide from the context menu. Please see the gif:
https://www.extendoffice.com/images/stories/comments/sun-comment/doc-hide-selected-row.gif
This comment was minimized by the moderator on the site
Hello,

I have a drop down with multiple reponses. I am trying to hide certain rows dependant on the response, can someone please assist?

Dropdown options are "CDI", "AR", "Legal", "Multiple" and "Other".

If response is CDI then hide rows 42-100

If response is AR then hide rows 19-41 and rows 66-100

If response is Legal then hide rows 19-66 and rows 88-100

If response is multiple then don't hide anything

If response is Other then hide rows 19-88



Can someone please asssist?
This comment was minimized by the moderator on the site
Hi I need some help with my work sheet. I have to build a dynamic questionnaire and I need to have a code that allow me to hide/ Unhide automatically some rows base on a cell information. Example:

if c6 is "internally" then show me row 7 but hide 8 to 107
if c6 is "Externally" then hide all the rows from 7 to 107


if c7 is "yes" then show me row 8 but hide 9 to 107
if c7 is "No" then show me row 8 but hide 9 to 107
if c8 is "Critical" then show me row 9 but hide 10 to 107

if c8 is "Important" show me row 9 but hide 10 to 107
if c8 is "Ordinary" show me row 9 but hide 10 to 107
if c8 is "Other" then show me row 9 but hide 10 to 107

if c9 is "Critical" then show me row 10 but hide 11 to 107
if c9 is "Important" then show me row 10 but hide 11 to 107
if c9 is "Ordinary" then show me row 10 but hide 11 to 107
if c9 is "Other" then show me row 10 but hide 11 to 107

etc.

can somebody help me?
This comment was minimized by the moderator on the site
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row = 1 Then

If Target.Value = "YES" Then
Worksheets(2).Activate
Worksheets(2).Application.Columns("A:Z").Select
Worksheets(2).Application.Selection.EntireColumn.Hidden = True
Worksheets(2).Application.Columns("AA:AZ").Select
Worksheets(2).Application.Selection.EntireColumn.Hidden = False
ElseIf Target.Value = "NO" Then
Worksheets(2).Activate
Worksheets(2).Application.Columns("AA:AZ").Select
Worksheets(2).Application.Selection.EntireColumn.Hidden = True
Worksheets(2).Application.Columns("A:Z").Select
Worksheets(2).Application.Selection.EntireColumn.Hidden = False
Else
Worksheets(2).Activate
Worksheets(2).Application.Columns("A:Z").Select
Worksheets(2).Application.Selection.EntireColumn.Hidden = False
Worksheets(2).Application.Columns("AA:AZ").Select
Worksheets(2).Application.Selection.EntireColumn.Hidden = False
End If

End If
End Sub
This comment was minimized by the moderator on the site
I got same error
This comment was minimized by the moderator on the site
Sorry I do not know either.
This comment was minimized by the moderator on the site
I don't know either Sunny
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations