hidding a column based on an outcome to an if statement

dusty

Registered User.
Local time
Yesterday, 19:53
Joined
Aug 20, 2009
Messages
42
I need to know how to compare a collumn with a cell and hide the collum the cell is in if any of the cells from the collumn do not match the cell

for example IF collumn A( from A3 till end) does not = B2 hide collumn B

also can this be continuosly running so that if the collum changed hidden collums could be unhiden and new ones hidden?

Cheers Dusty
 
Hi, Dusty,

I do have some problems understanding what you are after. Maybe the VBA Code

Code:
Range("B2").EntireColumn.Hidden = (WorksheetFunction.CountIf(Range("A3:A" & Rows.Count), Range("B2")) > 0)
may give you a hint where to go (if a column is hidden you can´t use the column itself for any start of a procedure or an event, so I think the Worksheet_Change event won´t be of much use here).

Ciao,
Holger
 
thanks for the reply
 

Users who are viewing this thread

Back
Top Bottom