Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I am trying to write a macro which will hide columns that do not have a "1" in row 2. This is the code I am using, but there is something wrong with it. Is anyone able to help? Dim rng As range Dim c As range For Each c In Intersect(ActiveSheet.UsedRange, ActiveSheet.range("a2:bd2")) If InStr(1, c.Text, 0) 0 Then If rng Is Nothing Then Set rng = c Else Set rng = Union(rng, c) End If End If Next c rng.Columns.Hidden = True |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to Hide columns | Excel Discussion (Misc queries) | |||
Need a macro to hide certain columns | Excel Discussion (Misc queries) | |||
I set up a macro to hide/unhide columns. It hides more columns | Excel Programming | |||
hide columns macro | Excel Programming | |||
macro to hide columns | Excel Worksheet Functions |