Having columns match numbers in one column

Having columns match numbers in one column

Post by Mike » Fri, 10 Feb 2006 22:06:32


Good Morning All,
Excel XP


Example:

A B C D E F
----------------------------------------------
1 Apples 3 x x x
2 Plums 2 x x
3 Grapes 0
4 Bananas 4 x x x x
5 Oranges 3 x x x


I have 5 products in A1:A5 and a number in B1:B5. Is it possible to have an
"x" placed automatically in C1:F5 for the numbers in B1:B5 and as they
change to automatically place the "x" in the column.
In this example if Apples total changes to 4, to have it place an "x" in F1.

Thanks in advance,
Mike
 
 
 

Having columns match numbers in one column

Post by Don Guille » Fri, 10 Feb 2006 22:53:18

right click sheet tab>view code>copy paste this.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 2 Then Exit Sub
tr = Target.Row
Range(Cells(tr, 3), Cells(tr, Target + 2)) = "x"
End Sub


--
Don Guillett
SalesAid Software
XXXX@XXXXX.COM

 
 
 

Having columns match numbers in one column

Post by kcc » Sat, 11 Feb 2006 12:48:21

C1=IF($B1>=(COLUMN()-2),"x","")
and copy over C1:F5.
kcc