Skip i'r prif gynnwys

Sut i dynnu sylw at gell neu res gyda blwch gwirio yn Excel?

Fel y dangosir isod y llun, mae angen i chi dynnu sylw at res neu gell gyda blwch gwirio. Pan fydd blwch gwirio yn cael ei wirio, bydd rhes benodol neu gell yn cael ei hamlygu'n awtomatig. Ond sut i'w gyflawni yn Excel? Bydd yr erthygl hon yn dangos dau ddull i chi ei gyflawni.

Tynnwch sylw at gell neu res gyda blwch gwirio gyda Fformatio Amodol
Tynnwch sylw at gell neu res gyda blwch gwirio gyda chod VBA


Tynnwch sylw at gell neu res gyda blwch gwirio gyda Fformatio Amodol

Gallwch greu rheol Fformatio Amodol i dynnu sylw at gell neu res gyda blwch gwirio yn Excel. Gwnewch fel a ganlyn.

Cysylltwch yr holl flwch gwirio â chell benodol

1. Mae angen i chi fewnosod blychau gwirio mewn celloedd fesul un â llaw trwy glicio Datblygwr > Mewnosod > Blwch Gwirio (Rheoli Ffurflen).

2. Nawr bod blychau gwirio wedi'u mewnosod mewn celloedd yng ngholofn I. Dewiswch y blwch gwirio cyntaf yn I1, nodwch y fformiwla = $ J1 i mewn i'r bar fformiwla, ac yna pwyswch y Rhowch allweddol.

Tip: Os nad ydych am gael gwerthoedd sy'n gysylltiedig mewn celloedd cyfagos â blychau gwirio, gallwch gysylltu'r blwch gwirio â chell taflen waith arall fel = Taflen3! $ E1.

2. Ailadroddwch gam 1 nes bod yr holl flychau gwirio wedi'u cysylltu â'r celloedd neu'r celloedd cyfagos mewn taflen waith arall.
Nodyn: Dylai'r holl gelloedd cysylltiedig fod yn olynol ac wedi'u lleoli yn yr un golofn.

Creu rheol Fformatio Amodol

Nawr mae angen i chi greu rheol Fformatio Amodol fel a ganlyn gam wrth gam.

1. Dewiswch y rhesi y mae angen i chi dynnu sylw atynt gyda blychau gwirio, yna cliciwch Fformatio Amodol > Rheol Newydd O dan y Hafan tab. Gweler y screenshot:

2. Yn y Rheol Fformatio Newydd blwch deialog, mae angen i chi:

2.1 Dewiswch y Defnyddiwch fformiwla i bennu pa gelloedd i'w fformatio opsiwn yn y Dewiswch Math o Reol blwch;

2.2 Rhowch y fformiwla = OS ($ J1 = GWIR, GWIR, GAU) i mewn i'r Gwerthoedd fformat lle mae'r fformiwla hon yn wir blwch;
      Or = OS (Taflen3! $ E1 = GWIR, GWIR, GAU) os oedd y blychau gwirio yn gysylltiedig â thaflen waith arall.

2.3 Cliciwch y fformat botwm i nodi lliw wedi'i amlygu ar gyfer y rhesi;

2.4 Cliciwch y OK botwm. Gweler y screenshot:

Nodyn: Yn y fformiwla, $ J1 or $ E1 yw'r gell gysylltiedig gyntaf ar gyfer y blychau gwirio, a gwnewch yn siŵr bod cyfeirnod y gell wedi'i newid i golofn absoliwt (J1> $ J1 or E1> $ E1).

Nawr mae'r rheol Fformatio Amodol yn cael ei chreu. Wrth wirio'r blychau gwirio, bydd y rhesi cyfatebol yn cael eu hamlygu'n awtomatig fel y dangosir llun megin.


Tynnwch sylw at gell neu res gyda blwch gwirio gyda chod VBA

Gall y cod VBA canlynol hefyd eich helpu i dynnu sylw at gell neu rwyfo gyda blwch gwirio yn Excel. Gwnewch fel a ganlyn.

1. Yn y daflen waith mae angen i chi dynnu sylw at gell neu res gyda'r blwch gwirio. De-gliciwch y Tab Dalen a dewis Gweld y Cod o'r ddewislen clicio ar y dde i agor y Microsoft Visual Basic ar gyfer Ceisiadau ffenestr.

2. Yna copïwch a gludwch y cod VBA isod i mewn i ffenestr y Cod.

Cod VBA: Rhes uchafbwynt gyda blwch gwirio yn Excel

Sub AddCheckBox()
Dim xCell As Range
Dim xRng As Range
Dim I As Integer
Dim xChk As CheckBox
On Error Resume Next
InputC:
    Set xRng = Application.InputBox("Please select the column range to insert checkboxes:", "Kutools for Excel", Selection.Address, , , , , 8)
If xRng Is Nothing Then Exit Sub
If xRng.Columns.Count > 1 Then
    MsgBox "The selected range should be a single column", vbInformation, "Kutools fro Excel"
    GoTo InputC
Else
    If xRng.Columns.Count = 1 Then
        For Each xCell In xRng        
            With ActiveSheet.CheckBoxes.Add(xCell.Left, _
               xCell.Top, xCell.Width = 15, xCell.Height = 12)
               .LinkedCell = xCell.Offset(, 1).Address(External:=False)
               .Interior.ColorIndex = xlNone
               .Caption = ""
               .Name = "Check Box " & xCell.Row
            End With    
            xRng.Rows(xCell.Row).Interior.ColorIndex = xlNone                  
        Next        
    End If    
    With xRng    
     .Rows.RowHeight = 16    
    End With   
    xRng.ColumnWidth = 5#    
    xRng.Cells(1, 1).Offset(0, 1).Select    
    For Each xChk In ActiveSheet.CheckBoxes   
      xChk.OnAction = ActiveSheet.Name + ".InsertBgColor"      
    Next
End If
End Sub

Sub InsertBgColor()
Dim xName As Integer
Dim xChk As CheckBox
For Each xChk In ActiveSheet.CheckBoxes 
  xName = Right(xChk.Name, Len(xChk.Name) - 10) 
  If (xName = Range(xChk.LinkedCell).Row) Then   
   If (Range(xChk.LinkedCell) = "True") Then   
    Range("A" & xName, Range(xChk.LinkedCell).Offset(0, -2)).Interior.ColorIndex = 6    
   Else    
    Range("A" & xName, Range(xChk.LinkedCell).Offset(0, -2)).Interior.ColorIndex = xlNone  
   End If  
  End If
Next
End Sub

3. Gwasgwch y F5 allwedd i redeg y cod. (Nodyn: dylech roi'r cyrchwr yn rhan gyntaf y cod i gymhwyso'r allwedd F5) Wrth popio i fyny Kutools ar gyfer Excel blwch deialog, dewiswch yr ystod rydych chi am ei mewnosod blychau gwirio, ac yna cliciwch ar y OK botwm. Dyma fi'n dewis ystod I1: I6. Gweler y screenshot:

4. Yna rhoddir blychau gwirio mewn celloedd dethol. Gwiriwch unrhyw un o'r blychau gwirio, bydd y rhes gyfatebol yn cael ei hamlygu'n awtomatig fel y dangosir isod.


Erthyglau perthnasol:

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 (3)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
This is a horrendous article. It lacks a lot of information and steps. If you follow this article verbatim it will not end in the result you are seeking.

Essentially the article is saying to have 2 columns where the checkboxes are linked to adjacent columns to enter in values which are then used for conditional formats. No one wants to have values associated in adjacent cells to checkboxes. Lastly, if this is the route you're going you're not linking checkboxes to conditional formats, you are linking checkboxes to cell values which are then in turn associated to conditional formats.

It is easier to just use icons instead of checkboxes (use the green checkmark icon) and create the conditional formats for a value of 1 or 0. If cell = 1 then it will replace the value with the icon and highlight your row. To accomplish this you use 2 conditional formats on your table.

Top left of table is B4, bottom right of table is L28

1st conditional format:
USE A FORMULA TO DETERMINE WHICH CELLS TO FORMAT
Formula: =$B4=1
Format: fill
Applies to: =$B4:$L28

2nd conditional format:
FORMAT CELLS BASED ON THEIR VALUES
Icon Set Custom
SHOW ICON ONLY (check this box off)
First icon (green checkmark) when value is > = 1 (type: number)
Second icon (no icon) when value is > = -1 (type: number)
Third icon (no icon) when < -1

Now, when I enter a 1 in B4 or any of the B column cells, it will highlight the entire row for me and replace the "1" with a checkmark.

BUILT-IN TEMPLATE WITH THIS FORMATTING:
1) Open Excel, search for a new template. Enter "Inventory" as the search term
2) Select the template titled "Inventory list with highlighting"
3) Highlight the first row of the table, open conditional formats to manage/edit. You will see the 2nd and 3rd formats are for highlights and the icon in the B column. You can change the icon to whatever you want. Remove the first format if you don't want the strikeout options from the Discontinued column.
This comment was minimized by the moderator on the site
I have a question about the initial step of linking the checkbox to a true/false.

1. Select the first check box in I1, enter formula =$J$1 into the formula bar, and then press the Enter key.

2. Repeat step 1 until all check boxes are linked to the adjacent cells.

For the repeat, does it have to be done for each cell or can you get the drag down to autofill? Right now, when I drag down the corner box it will autofill with =$J$1 for everything so that if I check one box, every box is checked. How can I fix this without manually linking each checkbox?
This comment was minimized by the moderator on the site
Hi,
The Fill Handle can't help in this case. You need to manually link each checkbox to its adjacent cell.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations