Բաց թողնել հիմնական բովանդակությունը

Ինչպե՞ս ներդնել գունավոր ծածկագրված ցուցակը Word աղյուսակում:

Ենթադրելով, որ ես ունեմ իմ Word փաստաթղթի մեջ մի աղյուսակ, և այժմ, ես ուզում եմ գունավոր կոդավորված բացվող ցուցակը տեղադրել սեղանի սյունակում: Դա նշանակում է, երբ ես բացվող վայրից ընտրում եմ մեկ տարբերակ, բջիջի գույնը դառնում է կարմիր, և երբ ես ընտրում եմ մեկ այլ տարբերակ ներքևում, բջջի գույնը դառնում է կանաչ, ինչպես ցույց է տրված հետևյալ նկարը: Ինչպե՞ս կարող եք լուծել այս աշխատանքը Word փաստաթղթում:

doc գույնը ծածկագրված է ներքևում

Տեղադրեք գունավոր կոդավորված բացվող ցուցակը Word փաստաթղթում ՝ VBA կոդով


Տեղադրեք գունավոր կոդավորված բացվող ցուցակը Word փաստաթղթում ՝ VBA կոդով

Հետևյալ քայլերը կարող են օգնել ավարտել այս առաջադրանքը ըստ անհրաժեշտության, նախ տեղադրեք բացվող ցուցակը և այնուհետև կիրառեք գույնը ներքևում: Խնդրում եմ արեք այսպես.

1, Աղյուսակում ընտրեք այն բջիջը, որտեղ ցանկանում եք ներդիրը ներդնել և սեղմել Երեվակիչ > Բացվող ցուցակի բովանդակության վերահսկում պատկերակ, տես նկարի նկարը.

փաստաթղթի գույնը ծածկագրված է ներքևում 1

2, Բացվող գիծը տեղադրվում է հատուկ բջիջի մեջ և այնուհետև կտտացնում Երեվակիչ > Հատկություններ, տես նկարի նկարը.

փաստաթղթի գույնը ծածկագրված է ներքևում 2

3, Մեջ Բովանդակության վերահսկման հատկություններ երկխոսության տուփ, խնդրում ենք կատարել հետևյալ գործողությունները.

(1.) Վերնագրի անունը մուտքագրեք հետևյալում կոչում տեքստային տուփ;

(2.) Կտտացրեք Ավելացնել կոճակը գնալ դեպի Ավելացնել ընտրություն երկխոսություն;

(3.) Ի Ավելացնել ընտրություն երկխոսություն, մուտքագրեք բացվող ցուցակի կետը մեջ Ցուցադրել Անունը տեքստային վանդակում:

փաստաթղթի գույնը ծածկագրված է ներքևում 3

4. Կրկնեք Քայլ 3-ը ՝ ըստ ցանկության այլ բացվող ցուցակի տարրեր տեղադրելու համար:

5, Առաջին բացվող ցուցակը ստեղծելուց հետո կարող եք պատճենել և տեղադրել այն այլ բջիջներում, որքան ձեզ հարկավոր է: Տեսեք,

փաստաթղթի գույնը ծածկագրված է ներքևում 4

6, Ապա դուք պետք է կիրառեք VBA կոդ, պահեք այն ALT + F11 բացել ստեղները Microsoft Visual Basic հավելվածների համար պատուհան.

7, Մեջ Microsoft Visual Basic հավելվածների համար պատուհանը, կրկնակի սեղմեք Այս Փաստաթուղթը - ից Projectրագիր-նախագիծ ռեժիմը բացելու պատուհանը, այնուհետև պատճենեք և կպցրեք հետևյալ կոդը դատարկ մոդուլի մեջ:

VBA ծածկագիր. Տեղադրեք գունավոր կոդավորված բացվող ցուցակը Word փաստաթղթի աղյուսակում.

Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl.Range
    If ContentControl.Title = "Status" Then
        Select Case .Text
            Case "Complete"
                .Cells(1).Shading.BackgroundPatternColor = wdColorRed
            Case "In Progress"
                .Cells(1).Shading.BackgroundPatternColor = wdColorGreen
            Case "Not Start"
                .Cells(1).Shading.BackgroundPatternColor = wdColorBlue
            Case Else
                .Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic
        End Select
    End If
End With
End Sub

փաստաթղթի գույնը ծածկագրված է ներքևում 5

ՆշումՎերոհիշյալ ծածկագրում Ստատուս վերնագրի անունն է, երբ ստեղծում ես բացվող ցուցակը, և ամբողջական, Շարունակվում է, Չսկսել բացվող ցուցակի տարրերն են, դրանք կարող եք փոխել ձեր սեփականով: Եվ դուք կարող եք նաև գույնը փոխել ձեր կարիքի:

8, Ապա պահեք և փակեք ծածկագրի պատուհանը, այժմ, երբ բացվող ցուցակից ընտրեք մեկ կետ, նրա հարաբերական գույնը կլրացվի բջիջով, տես նկարի նկարը.

doc գույնը ծածկագրված է ներքևում


 

Գրասենյակի արտադրողականության լավագույն գործիքները

Kutools բառի համար - Բարձրացրեք ձեր բառի փորձը Over-ի հետ 100 Ուշագրավ առանձնահատկություններ!

🤖 Kutools AI օգնականՓոխակերպեք ձեր գրածը AI-ի միջոցով - Ստեղծեք բովանդակություն  /  Վերաշարադրել տեքստը  /  Ամփոփել փաստաթղթերը  /  Հարցրեք տեղեկատվության համար Փաստաթղթի հիման վրա, բոլորը Word-ի շրջանակներում

📘 Փաստաթղթերի տիրապետում: Էջերի բաժանում  /  Միաձուլեք փաստաթղթերը  /  Արտահանել ընտրություն տարբեր ձևաչափերով (PDF/TXT/DOC/HTML...)  /  Խմբաքանակի փոխակերպում PDF-ի  /  Արտահանել էջերը որպես պատկերներ  /  Միանգամից մի քանի ֆայլ տպեք...

Բովանդակության խմբագրում: Խմբաքանակի որոնում և փոխարինում Բազմաթիվ Ֆայլերի միջով  /  Չափափոխել բոլոր նկարները  /  Փոխադրել աղյուսակի տողերը և սյունակները  /  Աղյուսակը տեքստի վերափոխել...

🧹 Անհեշտ մաքրություն:Հեռացրու Լրացուցիչ տարածքներ  /  Բաժնի ընդմիջումներ  /  Բոլոր վերնագրերը  /  Տեքստային տուփեր  /  Hyperlinks  / Լրացուցիչ հեռացման գործիքների համար այցելեք մեր Հեռացնել խումբը...

Ստեղծագործական ներդիրներՆերդիր Հազար բաժանիչներ  /  Նշեք վանդակները  /  Ռադիո կոճակներ  /  QR Code  /  Շտրիխ կոդ  /  Անկյունագծային աղյուսակ  /  Հավասարության վերնագիր  /  Նկարի վերնագիր  /  Աղյուսակի վերնագիր  /  Բազմաթիվ նկարներ  / Բացահայտեք ավելին Տեղադրեք խումբը...

🔍 Ճշգրիտ ընտրանքներ: Մատնանշել կոնկրետ էջեր  /  սեղաններ  /  ձեւավորում  /  վերնագրի պարբերություններ  / Ընդլայնել նավարկությունը ավելին Ընտրեք հատկանիշներ...

Աստղերի բարելավումներ: Արագ նավարկեք ցանկացած վայր  /  կրկնվող տեքստի ավտոմատ տեղադրում  /  անխափան անցում փաստաթղթի պատուհանների միջև  /  11 Փոխակերպման գործիքներ...

???? Ցանկանու՞մ եք փորձել այս հնարավորությունները: Kutools-ը Word-ի համար առաջարկում է ա 60 օր անվճար դատավարություն, առանց սահմանափակումների! 🚀
 

 

Comments (54)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
hello . i tried but it not go.
This comment was minimized by the moderator on the site
bonjour, je ne parviens pas à enregistrer
This comment was minimized by the moderator on the site
I have a word document that i would like some help with, in short, i have a large inspection table, items either comply, don't, further information etc. I currently use a simple drop-down option which has 5-6 options, ill like a selection option that when different options are selected, that changes the cells/row to a red or green etc, and then also (If possible) updates a Summary Table? is this possible, I'll pay someone for a general templet i can the work on....

Thank you in advance....
This comment was minimized by the moderator on the site
Hello, peter,
Did you mean to select an item from the drop down list, and a specific background color is filled for that row?
Please view the attachment to check if it is your need. If this is not your need, please give your problem more clearly.
Thank you!
This comment was minimized by the moderator on the site
Almost, by changing the drop-down tab the whole row changes color, perfect, thank you, however the magic is then coping the row (Yet only rows that don't comply or need further info etc... ) and placing it in a summary table at the top of the page in another table etc... getting them all to keep adding would be great in a summary table.

I can then alter the summary table as things change, and it updated the main parent table .... I'm not sure this is possible.

I'm happy to have a Teams Meeting to get this working, it would be apricated as it is doing my head in...

This comment was minimized by the moderator on the site
Hi, this is great, got me over a major problem with my fillable form. However, when I go to protect my fillable form, it brings up the debugger box? any idea how i can overcome this?
This comment was minimized by the moderator on the site
Thank you, i have managed to change the background colour. Is there a way i can change the text to white?
This comment was minimized by the moderator on the site
Hello, Emily,
To change the text color to white, please apply the following code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
With ContentControl.Range
    If ContentControl.Title = "Status" Then
        Select Case .Text
            Case "Complete"
                .Cells(1).Shading.BackgroundPatternColor = wdColorRed
                .Cells(1).Range.Font.Color = wdColorWhite
            Case "In Progress"
                .Cells(1).Shading.BackgroundPatternColor = wdColorGreen
                .Cells(1).Range.Font.Color = wdColorWhite
            Case "Not Start"
                .Cells(1).Shading.BackgroundPatternColor = wdColorBlue
                .Cells(1).Range.Font.Color = wdColorWhite
            Case Else
                .Cells(1).Shading.BackgroundPatternColor = wdColorAutomatic
        End Select
    End If
End With
End Sub

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
What code do you add so it goes back to the normal colours (both background and text) when you select "Choose an item" from dropdown list after previously selecting a case
This comment was minimized by the moderator on the site
Hello, Usama,
In this case, the code in this article can help you. When uou select an item and then do back to choosing "Choose an item", the backdround color will not be filled.
Please try again. Thank you!
This comment was minimized by the moderator on the site
Well done! Is it possible to activate different cells (independent of row and column) with an item of the ContentControl... e.g. if we put the alphabet of English letters in a table with 6 rows and 5 columns and want to activate the vowels or the consonants?
This comment was minimized by the moderator on the site
Well done! Is it possible to activate different cells (independent of row and column) with an item of the ContentControl... e.g. if we put the alphabet of English letters in a table with 6 rows and 5 columns and want to activate the vowels or the consonants?
This comment was minimized by the moderator on the site
Hi I want a drop down list of colours but i do not want any text in the cells, i just want my users to be able to choose a colour as I am creating a RAG rated form.

is this possible?

thanks.
This comment was minimized by the moderator on the site
Probably way too late, but in case anyone else is wondering, you can probably do something like this by just adapting the code a bit.

adjust the range.font.color line with the same wd color code as the code above. Its not perfect but if the font is the same color as the highlight, you wont be able to visually see the difference
This comment was minimized by the moderator on the site
I have pasted the code and can see my drop down options (the text) but when I choose them, the background colors don't apply. Do you have any way to help me figure out what I may be doing wrong? Please and thank you! This is exactly what I'm hoping to do in my document, if I can make it work. Thanks!
This comment was minimized by the moderator on the site
Hello, Susan
You should check if the corresponding text in the VBA code has been mofified to your own contents.

Note: In the above code, Status is the title name when you creating the drop down list, and Complete, In Progress, Not Start are the items of the drop down list, you can change them to your own. And you can also change the color to your need.

If there is still problem after changing the text, you can upload the attachment word file and we will help you check it.
Thank you!
This comment was minimized by the moderator on the site
I am having the same issue.
I have changed the titles names in the code and followed the rest of the instructions.
Can you please tell me what I may have done wrong?
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