Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-30-2022, 05:06 PM
tico22 tico22 is offline Drop-down governing text and color of cell in table Windows 10 Drop-down governing text and color of cell in table Office 2016
Novice
Drop-down governing text and color of cell in table
 
Join Date: Jul 2022
Posts: 3
tico22 is on a distinguished road
Default Drop-down governing text and color of cell in table

Hi community



I am still a beginner with VBA and my goal is to have a dropdown that sets the text and color of the respective cell in a table:
- The user selects the red "level" and the requirements are populated based on it (low/med/high)
- Ideally, the cells or background of the low/med/high are also color-coded (this is where I struggle)
- See the screenshot for visualization

I managed to get the low/med/high texts updated based on the level input through CustomXMLNode, but I am currently still struggling with the coloring. The coloring seems inaccessible through the XMLNode...any ideas and also feedback on the code are greatly appreciated, thx!

PS: I am using BeforeStoreUpdate instead of OnExit because I want to have it more interactive/quicker given that there is no OnChange Event.
PPS: I am using content controls over form fields because a) more modern and b) more responsive at the cost of having to use macros. Do you agree with that?
PPPS: Linking to this for awareness.
Attached Images
File Type: png color_cells.png (22.0 KB, 18 views)
Attached Files
File Type: docm test10.docm (47.2 KB, 5 views)

Last edited by tico22; 07-31-2022 at 03:04 AM. Reason: more info
Reply With Quote
  #2  
Old 08-01-2022, 06:48 AM
macropod's Avatar
macropod macropod is offline Drop-down governing text and color of cell in table Windows 10 Drop-down governing text and color of cell in table Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Cross-posted at: events - VBA: Changing content control through truly dynamic drop-down - Stack Overflow
For cross-posting etiquette, please read: A message to forum cross posters - Excelguru
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 08-01-2022, 02:31 PM
tico22 tico22 is offline Drop-down governing text and color of cell in table Windows 10 Drop-down governing text and color of cell in table Office 2016
Novice
Drop-down governing text and color of cell in table
 
Join Date: Jul 2022
Posts: 3
tico22 is on a distinguished road
Default

Feel free to close here => should have asked directly on StackOverflow
Reply With Quote
Reply

Tags
vba content control

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop-down governing text and color of cell in table Drop down list change color of a table cell? templeowls Word 3 05-18-2022 02:59 PM
Drop down fields in Word - Change color of cell, then add text BernaDev202 Word VBA 3 08-09-2018 02:29 PM
Macro to change an RGB table cell shading color to another RGB color David Matthews Word VBA 4 05-29-2018 02:45 PM
Drop-down governing text and color of cell in table How to change the font color of specific text within a Word table cell epid011 Word Tables 2 05-15-2017 05:21 PM
Drop-down governing text and color of cell in table VBA Table – Search All Tables - Find & Replace Text in Table Cell With Specific Background Color jc491 Word VBA 8 09-30-2015 06:10 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:07 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft