Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-28-2021, 02:37 AM
S7ewie S7ewie is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells Office 2019
Novice
Conditionally Shade Table Cells
 
Join Date: Apr 2021
Posts: 5
S7ewie is on a distinguished road
Default Conditionally Shade Table Cells

Hi all,

I'm trying to shade a table cell based on the value of a mail merge field. In this case, I'm simply using "R", "G" and "B" to depict whether the cell is red green or blue. I'm trying to follow the section in the sticky on this but I'm just getting coloured text. Am I misunderstanding the use for this or doing something completely wrong?



I've made a single cell table, Alt+F9 to bring up the code. I'm using Ctrl+F to ender new brackets and "Insert Merge Field" to add fields. My current test code is:

Code:
{IF{ MERGEFIELD Name }= "R" "*tab**tab*
*tab*Test Text*tab*
*tab**tab*" \* Charformat }
This just gives me "Test Text" in red if the value is "R". I just want to shade the cell red with no text? Am I doing something wrong or have I misunderstood that this code is used for?
Reply With Quote
  #2  
Old 04-28-2021, 06:26 AM
macropod's Avatar
macropod macropod is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells 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

Did you try something as simple as omitting 'Test Text' and using shading instead of font colouring (as described in the Mailmerge Tips and Tricks thread)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 04-28-2021, 06:34 AM
S7ewie S7ewie is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells Office 2019
Novice
Conditionally Shade Table Cells
 
Join Date: Apr 2021
Posts: 5
S7ewie is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Did you try something as simple as omitting 'Test Text' and using shading instead of font colouring (as described in the Mailmerge Tips and Tricks thread)?
If I remove the text I just get a blank cell.

I thought I was following the sticky to be honest? I'm looking at the section titled "Conditionally Shade Table Cells".
Reply With Quote
  #4  
Old 04-28-2021, 01:43 PM
macropod's Avatar
macropod macropod is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells 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

Colouring the font and shading the range spanned by the tabs are not the same thing.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #5  
Old 04-29-2021, 12:50 AM
S7ewie S7ewie is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells Office 2019
Novice
Conditionally Shade Table Cells
 
Join Date: Apr 2021
Posts: 5
S7ewie is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Colouring the font and shading the range spanned by the tabs are not the same thing.
How do you shade a range? If I try to do that it just colors the whole cell background for each row.

EDIT: I've attached a couple of files to show what I'm working with, hopefully you can work out what I'm doing wrong?
Attached Files
File Type: docx Format Experiment.docx (20.1 KB, 22 views)
File Type: xlsx Test.xlsx (10.2 KB, 15 views)
Reply With Quote
  #6  
Old 04-29-2021, 01:30 AM
macropod's Avatar
macropod macropod is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells 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

See attached. The left column uses highlighting. The right column uses shading. Both are described on the Tips page.
Attached Files
File Type: docx Format Experiment.docx (19.5 KB, 58 views)
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #7  
Old 04-29-2021, 01:44 AM
S7ewie S7ewie is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells Office 2019
Novice
Conditionally Shade Table Cells
 
Join Date: Apr 2021
Posts: 5
S7ewie is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
See attached. The left column uses highlighting. The right column uses shading. Both are described on the Tips page.
Thank you so much! Working perfectly now!

Final question.. how did you remove that final small margin on the left? I have all margins set to zero but there's still a tiny gap on the left margin.
Reply With Quote
  #8  
Old 04-29-2021, 01:45 AM
macropod's Avatar
macropod macropod is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells 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

By using a negative paragraph indent.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #9  
Old 04-29-2021, 01:52 AM
S7ewie S7ewie is offline Conditionally Shade Table Cells Windows 10 Conditionally Shade Table Cells Office 2019
Novice
Conditionally Shade Table Cells
 
Join Date: Apr 2021
Posts: 5
S7ewie is on a distinguished road
Default

Got it! Thanks!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditionally Shade Table Cells Conditionally Colour/Shade Numeric Output Ranges E.Buttimer Mail Merge 1 03-25-2021 02:20 PM
Conditionally Highlighting Blank Cells by Quarter in Current Calendar Year PrincessApril Excel 2 11-29-2019 03:31 AM
Conditionally Shade Table Cells Text area in table won't shade LSHAW Word Tables 1 03-09-2017 03:08 PM
Conditionally Shade Table Cells How to conditionally format cells in Col. A if it matches adjacent cell in Col. B? alshcover Excel 2 06-03-2014 12:50 PM
How to merge two columns & replace contents of cells conditionally? mag Excel 3 10-24-2012 01:07 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:56 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