Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default why can't hide zero's based on a zero valuer in range

Sub Hidezeros()
Dim rRange As Range
For Each rRange In Range("A17", Range("A41").End(xlUp))
rRange.EntireRow.Hidden = _
(rRange = 0 And Len(rRange) = 1)
Next rRange
End Sub

I have a macro I found for hiding any rows where a zero is in column A for
the range of A17 to A41.

It is a simple quote sheet and if nothing is entered in the qty field then
those rows shoul dhide only not delete when a button is pushed on sheet

Also how would I say ranf A17 -to A25 & A27 to 31 - tow disconnected ranges.

thank you for your help and time on this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default why can't hide zero's based on a zero valuer in range

Sub HideZeros()

For i = 17 To Cells(Rows.Count,"A).End(xlUp).Row
If Cells(i,"A").Value = 0 Then
Rows(i).Hidden = True
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Sub Hidezeros()
Dim rRange As Range
For Each rRange In Range("A17", Range("A41").End(xlUp))
rRange.EntireRow.Hidden = _
(rRange = 0 And Len(rRange) = 1)
Next rRange
End Sub

I have a macro I found for hiding any rows where a zero is in column A for
the range of A17 to A41.

It is a simple quote sheet and if nothing is entered in the qty field then
those rows shoul dhide only not delete when a button is pushed on sheet

Also how would I say ranf A17 -to A25 & A27 to 31 - tow disconnected

ranges.

thank you for your help and time on this.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default why can't hide zero's based on a zero valuer in range

Thanks but what about disconnected ranges where I might want to read a17 to
25 then skip to a30 to 35 then a41 to 45 and the other rows not in these
range groups would have soemhting besides numbers in them - maybe blanks or
some writeign.

"Bob Phillips" wrote:

Sub HideZeros()

For i = 17 To Cells(Rows.Count,"A).End(xlUp).Row
If Cells(i,"A").Value = 0 Then
Rows(i).Hidden = True
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Sub Hidezeros()
Dim rRange As Range
For Each rRange In Range("A17", Range("A41").End(xlUp))
rRange.EntireRow.Hidden = _
(rRange = 0 And Len(rRange) = 1)
Next rRange
End Sub

I have a macro I found for hiding any rows where a zero is in column A for
the range of A17 to A41.

It is a simple quote sheet and if nothing is entered in the qty field then
those rows shoul dhide only not delete when a button is pushed on sheet

Also how would I say ranf A17 -to A25 & A27 to 31 - tow disconnected

ranges.

thank you for your help and time on this.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default why can't hide zero's based on a zero valuer in range

Maybe this is better

Sub HideZeros()
Dim rng As Range
Dim cell As Range

Set rng = Range("A17:A25,A30:A35,A41:A45")
For Each cell In rng
If cell.Value = 0 Then
Rows(cell.Row).Hidden = True
End If
Next cell

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Thanks but what about disconnected ranges where I might want to read a17

to
25 then skip to a30 to 35 then a41 to 45 and the other rows not in these
range groups would have soemhting besides numbers in them - maybe blanks

or
some writeign.

"Bob Phillips" wrote:

Sub HideZeros()

For i = 17 To Cells(Rows.Count,"A).End(xlUp).Row
If Cells(i,"A").Value = 0 Then
Rows(i).Hidden = True
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Sub Hidezeros()
Dim rRange As Range
For Each rRange In Range("A17", Range("A41").End(xlUp))
rRange.EntireRow.Hidden = _
(rRange = 0 And Len(rRange) = 1)
Next rRange
End Sub

I have a macro I found for hiding any rows where a zero is in column A

for
the range of A17 to A41.

It is a simple quote sheet and if nothing is entered in the qty field

then
those rows shoul dhide only not delete when a button is pushed on

sheet

Also how would I say ranf A17 -to A25 & A27 to 31 - tow disconnected

ranges.

thank you for your help and time on this.






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default run time ewrror or error 400

thansk for the time but I cannot make it go.

I get a red x box that says 400 or I get an error that says

run time error 1004
Application-defined or object-defined error

I make vba requests for stuff far more advanced then my vba skill set - I
always put down vba for long periods of time do to being pulled in different
directions

any thoughts

"Bob Phillips" wrote:

Maybe this is better

Sub HideZeros()
Dim rng As Range
Dim cell As Range

Set rng = Range("A17:A25,A30:A35,A41:A45")
For Each cell In rng
If cell.Value = 0 Then
Rows(cell.Row).Hidden = True
End If
Next cell

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Thanks but what about disconnected ranges where I might want to read a17

to
25 then skip to a30 to 35 then a41 to 45 and the other rows not in these
range groups would have soemhting besides numbers in them - maybe blanks

or
some writeign.

"Bob Phillips" wrote:

Sub HideZeros()

For i = 17 To Cells(Rows.Count,"A).End(xlUp).Row
If Cells(i,"A").Value = 0 Then
Rows(i).Hidden = True
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Sub Hidezeros()
Dim rRange As Range
For Each rRange In Range("A17", Range("A41").End(xlUp))
rRange.EntireRow.Hidden = _
(rRange = 0 And Len(rRange) = 1)
Next rRange
End Sub

I have a macro I found for hiding any rows where a zero is in column A

for
the range of A17 to A41.

It is a simple quote sheet and if nothing is entered in the qty field

then
those rows shoul dhide only not delete when a button is pushed on

sheet

Also how would I say ranf A17 -to A25 & A27 to 31 - tow disconnected
ranges.

thank you for your help and time on this.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 31
Default I used this from Tom O

This piece code worked - the sheet is not mine and the project is for someone
else there may be things int he sheet that are interfearing.

so at this point I ma good to go

Sub HideZeroRows()
Dim col As Integer
Dim rng As Range
Dim rng1 As Range
Dim i As Long
'specify column to check
col = 2
Rows.Hidden = False
Set rng = Range(Cells(1, col), Cells(Rows.Count, col).End(xlUp))
For i = rng.Rows(rng.Rows.Count).Row To 2 Step -1
If Cells(i, col).Value = 0 Then
Cells(i, col).EntireRow.Hidden = True
End If
Next
End Sub


"Todd F." wrote:

thansk for the time but I cannot make it go.

I get a red x box that says 400 or I get an error that says

run time error 1004
Application-defined or object-defined error

I make vba requests for stuff far more advanced then my vba skill set - I
always put down vba for long periods of time do to being pulled in different
directions

any thoughts

"Bob Phillips" wrote:

Maybe this is better

Sub HideZeros()
Dim rng As Range
Dim cell As Range

Set rng = Range("A17:A25,A30:A35,A41:A45")
For Each cell In rng
If cell.Value = 0 Then
Rows(cell.Row).Hidden = True
End If
Next cell

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Thanks but what about disconnected ranges where I might want to read a17

to
25 then skip to a30 to 35 then a41 to 45 and the other rows not in these
range groups would have soemhting besides numbers in them - maybe blanks

or
some writeign.

"Bob Phillips" wrote:

Sub HideZeros()

For i = 17 To Cells(Rows.Count,"A).End(xlUp).Row
If Cells(i,"A").Value = 0 Then
Rows(i).Hidden = True
End If
Next i

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Todd F." wrote in message
...
Sub Hidezeros()
Dim rRange As Range
For Each rRange In Range("A17", Range("A41").End(xlUp))
rRange.EntireRow.Hidden = _
(rRange = 0 And Len(rRange) = 1)
Next rRange
End Sub

I have a macro I found for hiding any rows where a zero is in column A

for
the range of A17 to A41.

It is a simple quote sheet and if nothing is entered in the qty field

then
those rows shoul dhide only not delete when a button is pushed on

sheet

Also how would I say ranf A17 -to A25 & A27 to 31 - tow disconnected
ranges.

thank you for your help and time on this.






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 row based on cell value jat Excel Worksheet Functions 2 February 19th 10 09:05 PM
Hide row based on cell value Munchkin Excel Worksheet Functions 2 June 25th 09 02:21 AM
Hide a row based on a cel value guillaume Excel Discussion (Misc queries) 5 May 18th 06 01:13 PM
Is there a way to hide worksheets and/or rows/columns based on information enter into a particular cell of range of cells? Marc New Users to Excel 1 March 10th 06 05:10 PM
Hide Row Based on cell value GaryF Excel Programming 3 April 27th 04 04:55 PM


All times are GMT +1. The time now is 07:15 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"