Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 22nd, 2012, 09:57 PM
Authorized User
 
Join Date: Jan 2012
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default need help with fill in cell color

I have a user form which asks the user to select a product they are about to test. Each product has different ranges.
Example of ranges:

Product Name Product Weight Product Length
xyz10 120 (+or-5) 190(+or-1.6)
xyz15 133 (+or-5) 241(+or-1.6)
xyz20 144 (+or-5) 292(+or-1.6)
xyz25 156 (+or-5) 343(+or-1.6)

So if product xyz20 is selected and the inputted weight into designated column ("E") is above 149 or below 139 (acceptable weight range)the cell should turn red automatically or after the enter key or even another cell is selected. Otherwise if the value is within acceptable weight range 139 to 149 the cell will turn green automatically or after the enter key or even another cell is selected.

sorry how it turned out. Hope it make sense.

Last edited by pooky; July 22nd, 2012 at 10:02 PM..
 
Old July 29th, 2012, 09:58 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Hi

If the Excel sheet and Range is constant you can add Conditional Formatting on the Sheet itself. OTH, if you want to have it dynamically, try using:

http://vbadud.blogspot.in/2009/08/ho...ons-using.html

Cheers
Shasur
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get Excel Cell color populate .NET Framework 2.0 2 March 3rd, 2014 04:25 AM
Change Cell Color phungleon HTML Code Clinic 2 April 9th, 2006 12:36 AM
Fill color in Excel Cell Anantsharma Excel VBA 14 October 25th, 2004 07:11 AM
text box to fill cell completely(no white border a Raif ASP.NET 1.0 and 1.1 Professional 0 August 20th, 2004 03:25 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.