Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Column - With text in cell
How can I make this macro work if my cells contain a text e.g AAA
instead of 0 & work on Sheet1, Sheet2 & Sheet3 Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < 0 Then cell.EntireColumn.Hidden = True End If Next cell End Sub Thxs |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Column - With text in cell
Sub Test1()
Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... How can I make this macro work if my cells contain a text e.g AAA instead of 0 & work on Sheet1, Sheet2 & Sheet3 Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < 0 Then cell.EntireColumn.Hidden = True End If Next cell End Sub Thxs |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Column - With text in cell
Thxs - but how about Sheet1 &Sheet2 &Sheet3
thxs Bob Phillips wrote: Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... How can I make this macro work if my cells contain a text e.g AAA instead of 0 & work on Sheet1, Sheet2 & Sheet3 Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < 0 Then cell.EntireColumn.Hidden = True End If Next cell End Sub Thxs |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Column - With text in cell
-- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... Thxs - but how about Sheet1 &Sheet2 &Sheet3 thxs Bob Phillips wrote: Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... How can I make this macro work if my cells contain a text e.g AAA instead of 0 & work on Sheet1, Sheet2 & Sheet3 Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < 0 Then cell.EntireColumn.Hidden = True End If Next cell End Sub Thxs |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Column - With text in cell
Sorry, didn't realise you want that included in the code
Sub Test1() Dim cell As Range Dim arySheets Dim sh As Worksheet arySheets = Array("Sheet1", "Sheet2", "Sheet3") For Each sh In Worksheets(arySheets) For Each cell In sh.Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell Next sh End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... Thxs - but how about Sheet1 &Sheet2 &Sheet3 thxs Bob Phillips wrote: Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... How can I make this macro work if my cells contain a text e.g AAA instead of 0 & work on Sheet1, Sheet2 & Sheet3 Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < 0 Then cell.EntireColumn.Hidden = True End If Next cell End Sub Thxs |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Hide Column - With text in cell
thxs!!!
Bob Phillips wrote: Sorry, didn't realise you want that included in the code Sub Test1() Dim cell As Range Dim arySheets Dim sh As Worksheet arySheets = Array("Sheet1", "Sheet2", "Sheet3") For Each sh In Worksheets(arySheets) For Each cell In sh.Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell Next sh End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... Thxs - but how about Sheet1 &Sheet2 &Sheet3 thxs Bob Phillips wrote: Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < "AAA" Then cell.EntireColumn.Hidden = True End If Next cell End Sub -- HTH RP (remove nothere from the email address if mailing direct) "O&O" wrote in message oups.com... How can I make this macro work if my cells contain a text e.g AAA instead of 0 & work on Sheet1, Sheet2 & Sheet3 Sub Test1() Dim cell As Range For Each cell In Range("c1:j1") If cell.Value < 0 Then cell.EntireColumn.Hidden = True End If Next cell End Sub Thxs |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hide column or row based on a cell in the column or row? | Excel Discussion (Misc queries) | |||
Hide Cell Row and column number | Excel Discussion (Misc queries) | |||
How do I hide text beyond the last column in Excel? | Excel Discussion (Misc queries) | |||
How to hide a column once any cell of that col. is not active any | Excel Programming | |||
Is there a way to hide text in a cell? | Excel Discussion (Misc queries) |