Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2018, 05:06 PM
kkkwj kkkwj is offline Set color and background of special bullet in table cell Windows 10 Set color and background of special bullet in table cell Office 2016
Novice
Set color and background of special bullet in table cell
 
Join Date: Nov 2017
Posts: 6
kkkwj is on a distinguished road
Default Set color and background of special bullet in table cell

Hi, I work with tables that contain special characters / shapes in table cells. The color of the shape/icon indicates yes, no, inactive, in-progress, etc. And I have to change the fill color of the table cell if I change the state (color) of the Wingding symbol. It's a huge pain to do all this with the mouse, right-clicking, etc. I'd like to bind a macro to a keybinding.



I'm having a hard time finding the code to do the color changes. I can't record a macro with the symbol selected (the macro doesn't record right-click mouse ops, etc.).

I've tried things like
Code:
   Selection.Font.Fill.ForeColor = wdRed
   Selection.Font.Fill.BackColor = wdGreen
   Selection.ShapeRange.Item(1).Fill.ForeColor = wdBlue
but without success. Could someone point me in the right direction (or better yet, show code) to change the color of the selected symbol and the background color of the table cell that holds the selected symbol? (I don't know if selecting something in a cell automatically selects the cell object too...)

Thank you
Reply With Quote
  #2  
Old 05-08-2018, 02:25 AM
slaycock slaycock is offline Set color and background of special bullet in table cell Windows 7 64bit Set color and background of special bullet in table cell Office 2016
Expert
 
Join Date: Sep 2013
Posts: 256
slaycock is on a distinguished road
Default

You need to identify the cell that has been selected.

Code:
With Selection.Range.Cells(1)
    .Range.Characters.First.Font.ColorIndex = wdGreen
    .Shading.Texture = wdTextureNone
    .Shading.ForegroundPatternColor = wdColorAutomatic
    .Shading.BackgroundPatternColor = wdColorOrange
End With
You can if you wish change .colorindex to .color. The .color property has been deprecated so no longer shows up in the intellisence but is still a fully functional property.
Reply With Quote
  #3  
Old 05-08-2018, 08:40 AM
kkkwj kkkwj is offline Set color and background of special bullet in table cell Windows 10 Set color and background of special bullet in table cell Office 2016
Novice
Set color and background of special bullet in table cell
 
Join Date: Nov 2017
Posts: 6
kkkwj is on a distinguished road
Default

OMG! Flawless and Perfect!

Thank you so much! I didn't even have to select the special symbol inside of the cell!

I will think of you and smile at your kindness every time I run the macro. Best regards, Kevin
Reply With Quote
Reply

Tags
symbol color, table cell bgcolor



Similar Threads
Thread Thread Starter Forum Replies Last Post
Allow Cell Background Fill/Text Color Change while Protected Sheets are Grouped RaudelJr Excel 5 04-18-2017 11:11 PM
Set color and background of special bullet in table cell 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
Setting a particular table cell background color when an option button is selected in Word 2007 a888 Word VBA 11 03-25-2015 05:33 AM
Set color and background of special bullet in table cell How to remove background color in a table that isn't there but is there? pintree3 Word 5 10-27-2014 10:23 AM
Set color and background of special bullet in table cell Cell Background Color: Base it on Content of Cell? tatihulot Excel 4 08-14-2013 03:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:11 PM.


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