LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default Hide when cell value (x) is < 1 but -1

On Mon, 8 Oct 2007 05:43:02 -0700, Craig147
wrote:

That is such a massive help thank you,

I just have a couple of queries

1) If i wanted to apply the same rule to columns B and D should I just copy
the IF formula and change to column numbers?


Yes.

Note that the column numbers are related to the AOI range. "1" is always the
first column in the AOI range which, if AOI does not start in Column A, may be
a different column.


2) The macro doesn't run when i press run it is only activated once i press
enter/return key after inputting one of the values in the table, is there any
way around this?


The macro was written as a worksheet change event, so only triggers on a
worksheet change.

If you want to run it optionally, as in Run Macro, then, instead of entering it
as a worksheet event, put it into a regular module (and DELETE it from the
worksheet module).

To enter it into a regular module, when you are in the "View Code" area, from
the top menu bar of the VBEditor select Insert/Module and paste the code below
into the window that opens.

Again, be sure to delete it from the worksheet module.

Modify the name and enter as follows:

================================================== ========
Option Explicit
Sub Hide()
Dim aoi As Range
Dim rw As Range
Set aoi = Range("a1:c5")

For Each rw In aoi.Rows
If rw.Columns(1) -1 And _
rw.Columns(1) < 1 And _
IsNumeric(rw.Columns(1)) = True And _
Len(rw.Columns(1).Text) 0 And _
rw.Columns(3) -1 And _
rw.Columns(3) < 1 And _
IsNumeric(rw.Columns(3)) = True And _
Len(rw.Columns(3).Text) 0 Then
rw.EntireRow.Hidden = True
Else
rw.EntireRow.Hidden = False
End If
Next rw
End Sub
==================================


Many thanks once again


You're welcome. Thanks for the feedback.
--ron
 
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
How can I change the size of a cell and hide what is in the cell? Elisabeth Excel Worksheet Functions 7 January 3rd 08 07:43 PM
auto-hide rows, cell format (# and @), update cell refs, shade cel Mo2 Excel Discussion (Misc queries) 0 April 17th 07 03:44 AM
Hide cell values based on a condition in another cell Cat Excel Worksheet Functions 1 January 4th 07 07:21 AM
Hide row if cell = 0 [email protected] Excel Worksheet Functions 1 June 28th 06 06:35 PM
Hide Value of Cell Mark Excel Discussion (Misc queries) 1 December 23rd 04 05:51 PM


All times are GMT +1. The time now is 09:32 AM.

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

About Us

"It's about Microsoft Excel"