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" <albert.ng@oneandonlyresorts.mu> wrote in message
news:1131528170.073883.159920@o13g2000cwo.googlegroups.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" <albert.ng@oneandonlyresorts.mu> wrote in message
> > news:1131527150.656272.205130@z14g2000cwz.googlegroups.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
> > >
>
Bookmarks