Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to hide rows in a range that have a certain value, withoutfiltering

Hi All,
How can I hide all rows in a range that have a certain value eg
"93/94"
and then hide those entire rows only.
Sort of like Find all instances of the value then EntireRoe.Hide
I don't want to use filtering as the spreadsheet is intricate and I
think filter coding might upset the structure.
Thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default How to hide rows in a range that have a certain value, without fil

There are many ways. you can run a loop on the column that would have these
values. So if the column were "D", then something like this maybe:

Sub HideByValue()
Dim LR as Long
LR = Range("D" & Rows.Count).End(xlUp).Row

For i = 1 to LR
If cells(i, "D") = "93/94" Then
Rows(i).EntireRow.Hidden = True
Else
Rows(i).EntireRow.Hidden = False
Next i
End Sub

That should get you going in the right direction.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.


" wrote:

Hi All,
How can I hide all rows in a range that have a certain value eg
"93/94"
and then hide those entire rows only.
Sort of like Find all instances of the value then EntireRoe.Hide
I don't want to use filtering as the spreadsheet is intricate and I
think filter coding might upset the structure.
Thank you

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to hide rows in a range that have a certain value, withoutfil

On May 22, 6:37*pm, JBeaucaire
wrote:
There are many ways. *you can run a loop on the column that would have these
values. So if the column were "D", then something like this maybe:

Sub HideByValue()
Dim LR as Long
LR = Range("D" & Rows.Count).End(xlUp).Row

For i = 1 to LR
If cells(i, "D") = "93/94" Then
Rows(i).EntireRow.Hidden = True
Else
Rows(i).EntireRow.Hidden = False
Next i
End Sub

That should get you going in the right direction.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.



" wrote:
Hi All,
How can I hide all rows in a range that have a certain value eg
"93/94"
and then hide those entire rows only.
Sort of like Find all instances of the value then EntireRoe.Hide
*I don't want to use filtering as the spreadsheet is intricate and I
think filter coding might upset the structure.
Thank you- Hide quoted text -


- Show quoted text -


Thank you but rather than kind of looping using that or a For..Next I
was looking for a way of finding all instances at once and then doing
the hiding.
But if needed will do the looping
thank you
Mark
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How to hide rows in a range that have a certain value, without

There is no findALL. You have 3 methods to use

1) Use filter which doesn't hid. Then use specialcells to capture the
visiable cells and hid them. Finally remove the filter using showall
2) Looping
3) Using find and findnext to located cells yo are looking for and then
hidding these rows.

" wrote:

On May 22, 6:37 pm, JBeaucaire
wrote:
There are many ways. you can run a loop on the column that would have these
values. So if the column were "D", then something like this maybe:

Sub HideByValue()
Dim LR as Long
LR = Range("D" & Rows.Count).End(xlUp).Row

For i = 1 to LR
If cells(i, "D") = "93/94" Then
Rows(i).EntireRow.Hidden = True
Else
Rows(i).EntireRow.Hidden = False
Next i
End Sub

That should get you going in the right direction.
--
"Actually, I *am* a rocket scientist." -- JB

Your feedback is appreciated, click YES if this post helped you.



" wrote:
Hi All,
How can I hide all rows in a range that have a certain value eg
"93/94"
and then hide those entire rows only.
Sort of like Find all instances of the value then EntireRoe.Hide
I don't want to use filtering as the spreadsheet is intricate and I
think filter coding might upset the structure.
Thank you- Hide quoted text -


- Show quoted text -


Thank you but rather than kind of looping using that or a For..Next I
was looking for a way of finding all instances at once and then doing
the hiding.
But if needed will do the looping
thank you
Mark

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 rows within range if B? = X BEEJAY Excel Programming 7 November 4th 08 07:13 PM
Code for Excel 2007 to hide rows based on sum of several rows not ina range Joe Gardill Excel Programming 2 August 29th 08 03:53 PM
Hide rows within a range IF... drumsab Excel Programming 4 November 27th 07 02:31 PM
Hide all rows within a range except one? mevetts Excel Discussion (Misc queries) 2 December 23rd 05 09:27 PM
Hide blank rows in a range trussman Excel Programming 0 February 18th 05 02:50 PM


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