Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Automatically Hide Rows

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Automatically Hide Rows

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Automatically Hide Rows

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Automatically Hide Rows

Tracy,

Slow down and read the advice I gave you, here it is again.

Right click your sheet tab, in the popup click on 'View code' and paste the
code in on the right. You still haven't told me which cell a 'certain cell'
is so this works on column D.

If Not Intersect(Target, Range("D:D")) Is Nothing Then

Change the D:D to whatver column you want F:F for column F for example.
I changed the code to work with 0 & 1.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O _
Or Target.Value = 1 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub



Mike


"Tracy" wrote:

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Automatically Hide Rows

O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?

--
Tracy


"Mike H" wrote:

Tracy,

Slow down and read the advice I gave you, here it is again.

Right click your sheet tab, in the popup click on 'View code' and paste the
code in on the right. You still haven't told me which cell a 'certain cell'
is so this works on column D.

If Not Intersect(Target, Range("D:D")) Is Nothing Then

Change the D:D to whatver column you want F:F for column F for example.
I changed the code to work with 0 & 1.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O _
Or Target.Value = 1 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub



Mike


"Tracy" wrote:

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Automatically Hide Rows

If you put the code where i advised then all you need to do is type 0 or 1 in
column D and the row where you put it will hide.

Mike

"Tracy" wrote:

O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?

--
Tracy


"Mike H" wrote:

Tracy,

Slow down and read the advice I gave you, here it is again.

Right click your sheet tab, in the popup click on 'View code' and paste the
code in on the right. You still haven't told me which cell a 'certain cell'
is so this works on column D.

If Not Intersect(Target, Range("D:D")) Is Nothing Then

Change the D:D to whatver column you want F:F for column F for example.
I changed the code to work with 0 & 1.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O _
Or Target.Value = 1 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub



Mike


"Tracy" wrote:

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default Automatically Hide Rows

Tracy wrote:
O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?


Have you considered using an AutoFilter? Not automatic, but fairly simple to
select only rows with a 1 in a certain column.
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Automatically Hide Rows

O.k I'm really close, but when I put in the number 1 the line disappears. I
need it to remain. You've been so very helpful. Thanks so much.
--
Tracy


"Mike H" wrote:

If you put the code where i advised then all you need to do is type 0 or 1 in
column D and the row where you put it will hide.

Mike

"Tracy" wrote:

O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?

--
Tracy


"Mike H" wrote:

Tracy,

Slow down and read the advice I gave you, here it is again.

Right click your sheet tab, in the popup click on 'View code' and paste the
code in on the right. You still haven't told me which cell a 'certain cell'
is so this works on column D.

If Not Intersect(Target, Range("D:D")) Is Nothing Then

Change the D:D to whatver column you want F:F for column F for example.
I changed the code to work with 0 & 1.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O _
Or Target.Value = 1 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub



Mike


"Tracy" wrote:

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Automatically Hide Rows

I guess this doesn't work on a worksheet where I already have all the
information put into column "B"?
--
Tracy


"Mike H" wrote:

If you put the code where i advised then all you need to do is type 0 or 1 in
column D and the row where you put it will hide.

Mike

"Tracy" wrote:

O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?

--
Tracy


"Mike H" wrote:

Tracy,

Slow down and read the advice I gave you, here it is again.

Right click your sheet tab, in the popup click on 'View code' and paste the
code in on the right. You still haven't told me which cell a 'certain cell'
is so this works on column D.

If Not Intersect(Target, Range("D:D")) Is Nothing Then

Change the D:D to whatver column you want F:F for column F for example.
I changed the code to work with 0 & 1.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O _
Or Target.Value = 1 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub



Mike


"Tracy" wrote:

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Automatically Hide Rows

ammended to hide the row only if a zero is entered. To hide rows that would
have been hidden previously had you had this code simply re-enter the zero.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("B:B")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

I guess this doesn't work on a worksheet where I already have all the
information put into column "B"?
--
Tracy


"Mike H" wrote:

If you put the code where i advised then all you need to do is type 0 or 1 in
column D and the row where you put it will hide.

Mike

"Tracy" wrote:

O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?

--
Tracy


"Mike H" wrote:

Tracy,

Slow down and read the advice I gave you, here it is again.

Right click your sheet tab, in the popup click on 'View code' and paste the
code in on the right. You still haven't told me which cell a 'certain cell'
is so this works on column D.

If Not Intersect(Target, Range("D:D")) Is Nothing Then

Change the D:D to whatver column you want F:F for column F for example.
I changed the code to work with 0 & 1.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value = O _
Or Target.Value = 1 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub



Mike


"Tracy" wrote:

Hi Mike, I tried that, but it didn't seem to work. The row needs to
disappear if there is a 0 in a certain cell. There are only two choices a
"0" or a "1". I can change those numbers to 1/2 or 3/4 if that helps.
Also when I paste the information does it need to be on Worksheet at the top
or anything else I may be missing?
--
Tracy


"Mike H" wrote:

Hi,

Not with a format but you can do it with event code like this. Right click
your sheet tab, view code and paste the code below in. As soon as a value
10 is entered in column D then the row is hidden.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
If IsNumeric(Target) And Target.Value 10 Then
Target.EntireRow.Hidden = True
End If
End If
End Sub

Mike

"Tracy" wrote:

Is there a way to format a worksheet to automatically hide rows if a certain
cell = a certain number?
--
Tracy



  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 70
Default Automatically Hide Rows

It works if all I want to do is view those rows only, but I have other rows
that need to remain in place. I was hoping for a simple fix.
--
Tracy


"Glenn" wrote:

Tracy wrote:
O.k I copied and pasted the information and then closed the application. The
MS Visual Basic is still on my task bar. The Column is "B" and I have two
choices to input, either 1 or 0. My spreadsheet is over 3000 rows long and I
need to view only the rows which contain the 1. Does the code automatically
work or do I have to do something else?


Have you considered using an AutoFilter? Not automatic, but fairly simple to
select only rows with a 1 in a certain column.

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
Automatically Hide rows with a value of zero [email protected] Excel Worksheet Functions 2 June 20th 07 08:13 PM
How do I set up Excel to automatically hide certain rows? Martin Excel Discussion (Misc queries) 3 December 13th 06 08:07 PM
automatically hide rows with zero value hfc21 Excel Worksheet Functions 1 January 23rd 06 07:33 PM
Hide rows automatically kim Excel Discussion (Misc queries) 1 September 14th 05 02:23 PM
How do I automatically hide rows RobRoy Excel Discussion (Misc queries) 8 February 2nd 05 01:12 PM


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

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"