Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-21-2012, 09:39 PM
Venky62 Venky62 is offline Change cell color when selection is made from a drop down list Windows 7 64bit Change cell color when selection is made from a drop down list Office 2010 32bit
Advanced Beginner
 
Join Date: Jul 2012
Posts: 58
Venky62 is on a distinguished road
Default

Here is the sample macro. It uses a select case method to test for different inputs in the active cell.

You can add as many conditions as you want by adding more Cases.
For now I have added two cases:

Case is = "BLUE"
Case Is = "Black"

Add more of these statements before the "End Select" statement and then change the .Font.color number and the .Interior.color constants as per need. Since I do not know what exact font color and interior colors you want for different selections, I have left it to you to fill them up.

Enter this macro in the "This workbook" code window. To do this, Press Alt+F11 and in the Visual Basic window that opens, look in the Project Explorer window which is to the left side. Doubleclick on the "This Workbook" and enter this code on the blank window that opens on the righthand side.
Attached Files
File Type: txt SampleFontCellColor.txt (771 Bytes, 29 views)
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Change cell color when selection is made from a drop down list Macro ? - Checkbox in Word + drop down selection help dice1976 Word 4 07-24-2012 11:18 AM
Change cell color everytime a value is selected in dropdown list angelica_gloria Excel 4 01-27-2012 06:47 PM
Made a mistake with a macro change lance_kidd Word 0 02-09-2011 06:36 PM
Ho to perform multi selection in drop down lists? nashville Word 0 09-29-2010 07:10 AM
How can I fill cell color starting from Cell D5 using Conditional formatting instead Learner7 Excel 0 07-08-2010 05:50 AM

Other Forums: Access Forums

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


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