Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
O&O O&O is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
O&O O&O is offline
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 118
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide column or row based on a cell in the column or row? SacGuy Excel Discussion (Misc queries) 0 January 24th 06 06:51 PM
Hide Cell Row and column number alexm999 Excel Discussion (Misc queries) 1 December 1st 05 02:29 PM
How do I hide text beyond the last column in Excel? GetVigilant-Jon Excel Discussion (Misc queries) 2 November 23rd 05 11:56 PM
How to hide a column once any cell of that col. is not active any Frederic Excel Programming 1 May 25th 05 02:21 PM
Is there a way to hide text in a cell? IT Assistant Excel Discussion (Misc queries) 2 April 27th 05 03:52 AM


All times are GMT +1. The time now is 07:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"