|
|
Automatic conditional formatting from a list
Hi All
I need a macro that colours cells if the product name in column A on it's
row matches any in the product list.
There is a list of product names in C17:End(xlUp).Row, that have different
backgrounds applied to each cell in the list.
The macro looks at Column A in the worksheet & compares it to the product
name list.
Where it finds a product name match, it goes across to columns I:BJ (on the
matched row) and applies the product name's background colour to any "active
cells" (i.e. value >0).
The following code does this but it's applies the background to the same
range as it's searching, and that data is a column - not a row...
How do I adapt it?
FYI
Z = product list starting from row 74 in the old code and already formatted
in different backgrounds
My range is C17:End(xlUp)
C = is the data being searched and having the background applied too - but
it's a column.
My range to search is column "A44:A200"
My range to apply the background too is "matched row between I:BJ".
Currently it's a Worksheet_SelectionChange type macro.
Will this make the file run slow? i.e. will it need to re-calculate &
re-apply alot?
If yes, can it be a normal macro where the user clicks the button to update
the cell formats on all rows within a range (e.g. 44:200) - but it will have
to clear the backgrounds before running each time.
______________________
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Cell As Integer
Dim Z As Integer
For Z = 74 To Cells(Rows.Count, "Z").End(xlUp).Row
For Cell = 95 To Cells(Rows.Count, "C").End(xlUp).Row
If Cells(Cell, "C").Value Like "*" & Range("Z" & Z).Value & "*" Then
Cells(Cell, "C").Interior.Color = Range("Z" & Z).Interior.Color
End If
Next Cell
Next Z
End Sub
--
Thank for your help in advance
BeSmart
|
|
0
|
|
|
|
Reply
|
Utf
|
3/5/2010 11:42:01 AM |
|
|
0 Replies
198 Views
(page loaded in 0.154 seconds)
Similiar Articles: Formatting a List Box for Uppercase - microsoft.public.access ...I'm trying to format the data in a List Box to be upper case. I've tried ">" in the ... Conditional formatting based on matching record in separate query ... Formatting a ... Conditional Formatting Does Not Refresh Automatically - microsoft ...Excel 2010 does not appear to re-apply conditional formatting when cell values ... Automatic calculation is activated, but conditional formatting won't update and neither ... Formatting automatic table of contents - microsoft.public.word ...Restart automatic table numbering in Annex - microsoft.public.mac ..... point where you want to change the number of ... Use automatic formatting as ... tab index on ... Conditional Formatting not recalculating - microsoft.public.excel ...I have set conditional formatting to hide certain selection boxes based on cell ... title: Automatic formatting is not always redrawn Long title Automatic formatting is ... Check boxes and conditional formatting - microsoft.public.mac ...> > I'm working in Mac Excel 2008, and also 2004 (to create the macros.) use a conditional format as you have already done, but have the format look at the contents of the ... Conditional Format, Color Scale adjacent cells - microsoft.public ..."Minty Fresh" wrote: > Hi Michael > Actually you can use conditional formatting to color a cell based on a value > in another cell. The real problem here is that you ... Conditional Formatting - Test Practice - microsoft.public.excel ...Conditional Formatting - Test Practice - microsoft.public.excel ... I can ... for the response, but is it not a bad practice ... Check boxes and conditional formatting ... Conditional Formatting based on Non Blank Cells - microsoft.public ...Automatic rounding and placement of decimals. - microsoft.public ... Conditional Formatting based on ... using a list of data defined in a rang ... Conditional Formatting ... How do i use Conditional formatting for 3+ conditions ...I have six types of current members that I want to highlight, but with conditional formatting I can only use 3 conditions in the members [Type] field. Data Validation - Conditional List - microsoft.public.excel ...Hi I have a data validation list which ... Forms by using Conditional Formatting ... This week, we will learn how to combine conditional formatting and data validation to ... Conditional FormattingHow to use Conditional Formatting in Microsoft Excel97 and Excel2000 to format cells based on their content, or the content of other cells. Lists, Conditional Formatting, Automatic page refresh?In SPt 2010, I have a HomePage, with a number of Project pages underneath. I think what I need to do is setup conditional formatting, and also an automatic ... Outlook Tips | Using Outlook's Automatic FormattingMicrosoft Outlook's Automatic Formatting (or Conditional formatting) lets you color items in a list, making them easier to see. Microsoft Excel: Conditional Format in a List - excel.itags.org... and need a little help with automatic row shading.I have the data entry = area set up as a list with a total row and have set up the following = conditional format to ... Excel - Conditional Formatting? With Drop-down List - Hello Heres ...Conditional Formatting? With Drop-down List - Hello Heres what i have ... value from a data validation list either "YES" or "X" I would like to have an automatic ... 7/24/2012 4:11:42 PM
|
|
|
|
|
|
|
|
|