Email:      Pass:    Pass?
Hi!
Close Window   
TE
Free Excel Tips in Your Email!
Join Over 20,000 Happy Subscribers!
E-mail:
Subscribe for Free Excel tips & more!
E-mail:


Advertisements


Free Excel Forum

Vba: How To Hide A Row (or Column) With Vba

Forum Register
Search Excel Forum Posts, Tutorials, Macros, Tips, and More

Hi

I would like to know, how could be possible to "hide" a row in the sheet with the VBa and later show it again. I can clear, delete,... it, but not hide.
I am making some kind of calculation price list and under some conditions, few rows has to be hidden.
Thank you for your help.

Bye-bye

View Answers     

Similar Excel Video Tutorials

Helpful Excel Macros

Hide Specific Comments in Excel - Comments Will Still Display on Hover
- Hide specific comments in Excel with this macro. Comments are still visible on hovering over the cell that contains the
Hide Comments in Excel Completely - Even Indicators Will not Appear
- Hide all comments in an Excel workbook. No indicators will be displayed and comments will not appear when you hover ove
Delete Hidden Rows in a Workbook
- This macro will delete hidden rows from every worksheet in an entire workbook. However, note that this will only delete
Hide Formulas in a Worksheet and Prevent Deletion
- This macro will hide all formulas within a workbook and not allow them to be deleted. The page will not be protected li
Delete Hidden Worksheets
- This macro will delete all hidden worksheets within a workbook. When you run this macro a warning window will pop up for

Similar Topics







Is there a shorter code I can use to hide/unhide rows with a VBA button?

There are no "fixed" range number of rows between Header to Header; they are random. Example: There are less rows between Header 1 to Header 2 then there are rows between Header 2 to Header 3, etc.

Header 1 at (A2:K2)

range: ( A4 : K190 )

***hide every 6 rows*** (A4 :K9), (A11:K16),(A18:K23), etc.

***then hide 5 rows range*** (A186: K190 )

Header 2 at (A191:K191)

range: ( A193 : K386 )

***hide every 6 rows, range:*** ( A193 :K198), (A200:K205),(A207:K212), etc.

***then hide 5 rows range*** (A382: K386 )

Header 3 at (A387:K387)

range: ( A389 : K582 )

***hide every 6 rows*** ( A389 :K394), (A396:K401), (A403:K408), etc.

***then hide 5 rows range*** (A578: K582 )

Header 4 at (A583:K583)

range: ( A585 : K701 )

***hide every 6 rows*** ( A585 :K589), (A592:K597), (A599:K604), etc.

***then hide 5 rows range*** (A697: K701 )

Here is the code I used, but I had to type in every range for it to work correctly.

Code:

Sub Hidden()
Application.ScreenUpdating = False
Rows("4:9").Hidden = Not Rows("4:9").Hidden
Rows("11:16").Hidden = Not Rows("11:16").Hidden
Rows("18:23").Hidden = Not Rows("18:23").Hidden
Rows("25:30").Hidden = Not Rows("25:30").Hidden
Rows("32:37").Hidden = Not Rows("32:37").Hidden
Rows("39:44").Hidden = Not Rows("39:44").Hidden
Rows("46:51").Hidden = Not Rows("46:51").Hidden
Rows("53:58").Hidden = Not Rows("53:58").Hidden
Rows("60:65").Hidden = Not Rows("60:65").Hidden
Rows("67:72").Hidden = Not Rows("67:72").Hidden
Rows("74:79").Hidden = Not Rows("74:79").Hidden
Rows("81:86").Hidden = Not Rows("81:86").Hidden
Rows("88:93").Hidden = Not Rows("88:93").Hidden
Rows("95:100").Hidden = Not Rows("95:100").Hidden
Rows("102:107").Hidden = Not Rows("102:107").Hidden
Rows("109:114").Hidden = Not Rows("109:114").Hidden
Rows("116:121").Hidden = Not Rows("116:121").Hidden
Rows("123:128").Hidden = Not Rows("123:128").Hidden
Rows("130:135").Hidden = Not Rows("130:135").Hidden
Rows("137:142").Hidden = Not Rows("137:142").Hidden
Rows("144:149").Hidden = Not Rows("144:149").Hidden
Rows("151:156").Hidden = Not Rows("151:156").Hidden
Rows("158:163").Hidden = Not Rows("158:163").Hidden
Rows("165:170").Hidden = Not Rows("165:170").Hidden
Rows("172:177").Hidden = Not Rows("172:177").Hidden
Rows("179:184").Hidden = Not Rows("179:184").Hidden
Rows("186:190").Hidden = Not Rows("186:190").Hidden
Rows("193:198").Hidden = Not Rows("193:198").Hidden
Rows("200:205").Hidden = Not Rows("200:205").Hidden
Rows("207:212").Hidden = Not Rows("207:212").Hidden
Rows("214:219").Hidden = Not Rows("214:219").Hidden
Rows("221:226").Hidden = Not Rows("221:226").Hidden
Rows("228:233").Hidden = Not Rows("228:233").Hidden
Rows("235:240").Hidden = Not Rows("235:240").Hidden
Rows("242:247").Hidden = Not Rows("242:247").Hidden
Rows("249:254").Hidden = Not Rows("249:254").Hidden
Rows("256:261").Hidden = Not Rows("256:261").Hidden
Rows("263:268").Hidden = Not Rows("263:268").Hidden
Rows("270:275").Hidden = Not Rows("270:275").Hidden
Rows("277:282").Hidden = Not Rows("277:282").Hidden
Rows("284:289").Hidden = Not Rows("284:289").Hidden
Rows("291:296").Hidden = Not Rows("291:296").Hidden
Rows("298:303").Hidden = Not Rows("298:303").Hidden
Rows("305:310").Hidden = Not Rows("305:310").Hidden
Rows("312:317").Hidden = Not Rows("312:317").Hidden
Rows("319:324").Hidden = Not Rows("319:324").Hidden
Rows("326:331").Hidden = Not Rows("326:331").Hidden
Rows("333:338").Hidden = Not Rows("333:338").Hidden
Rows("340:345").Hidden = Not Rows("340:345").Hidden
Rows("347:352").Hidden = Not Rows("347:352").Hidden
Rows("354:359").Hidden = Not Rows("354:359").Hidden
Rows("361:366").Hidden = Not Rows("361:366").Hidden
Rows("368:373").Hidden = Not Rows("368:373").Hidden
Rows("375:380").Hidden = Not Rows("375:380").Hidden
Rows("382:386").Hidden = Not Rows("382:386").Hidden
Rows("389:394").Hidden = Not Rows("389:394").Hidden
Rows("396:401").Hidden = Not Rows("396:401").Hidden
Rows("403:408").Hidden = Not Rows("403:408").Hidden
Rows("410:415").Hidden = Not Rows("410:415").Hidden
Rows("417:422").Hidden = Not Rows("417:422").Hidden
Rows("424:429").Hidden = Not Rows("424:429").Hidden
Rows("431:436").Hidden = Not Rows("431:436").Hidden
Rows("438:443").Hidden = Not Rows("438:443").Hidden
Rows("445:450").Hidden = Not Rows("445:450").Hidden
Rows("452:457").Hidden = Not Rows("452:457").Hidden
Rows("459:464").Hidden = Not Rows("459:464").Hidden
Rows("466:471").Hidden = Not Rows("466:471").Hidden
Rows("473:478").Hidden = Not Rows("473:478").Hidden
Rows("480:485").Hidden = Not Rows("480:485").Hidden
Rows("487:492").Hidden = Not Rows("487:492").Hidden
Rows("494:499").Hidden = Not Rows("494:499").Hidden
Rows("501:506").Hidden = Not Rows("501:506").Hidden
Rows("508:513").Hidden = Not Rows("508:513").Hidden
Rows("515:520").Hidden = Not Rows("515:520").Hidden
Rows("522:527").Hidden = Not Rows("522:527").Hidden
Rows("529:534").Hidden = Not Rows("529:534").Hidden
Rows("536:541").Hidden = Not Rows("536:541").Hidden
Rows("543:548").Hidden = Not Rows("543:548").Hidden
Rows("550:555").Hidden = Not Rows("550:555").Hidden
Rows("557:562").Hidden = Not Rows("557:562").Hidden
Rows("564:569").Hidden = Not Rows("564:569").Hidden
Rows("571:576").Hidden = Not Rows("571:576").Hidden
Rows("578:582").Hidden = Not Rows("578:582").Hidden
Rows("585:590").Hidden = Not Rows("585:590").Hidden
Rows("592:597").Hidden = Not Rows("592:597").Hidden
Rows("599:604").Hidden = Not Rows("599:604").Hidden
Rows("606:611").Hidden = Not Rows("606:611").Hidden
Rows("613:618").Hidden = Not Rows("613:618").Hidden
Rows("620:625").Hidden = Not Rows("620:625").Hidden
Rows("627:632").Hidden = Not Rows("627:632").Hidden
Rows("634:639").Hidden = Not Rows("634:639").Hidden
Rows("641:646").Hidden = Not Rows("641:646").Hidden
Rows("648:653").Hidden = Not Rows("648:653").Hidden
Rows("655:660").Hidden = Not Rows("655:660").Hidden
Rows("662:667").Hidden = Not Rows("662:667").Hidden
Rows("669:674").Hidden = Not Rows("669:674").Hidden
Rows("676:681").Hidden = Not Rows("676:681").Hidden
Rows("683:688").Hidden = Not Rows("683:688").Hidden
Rows("690:695").Hidden = Not Rows("690:695").Hidden
Rows("697:701").Hidden = Not Rows("697:701").Hidden
Application.ScreenUpdating = True
End Sub


--------------------------------------------------
Excel 2007 and Windows XP Professional


Hi,
I have three rows and 10 columns in my excel sheet
I'm trying to hide rows if the below conditions are matched:
if values of cells A1 through A10 are equal to either "/bin/touch" or "/bin/rm" and values of cells B1 through B10 are equal to either "b" or "f" then hide the entire row; else nothing should be done

how do i put these conditions into a macro,
below is my effort towards a Formula:
Code:

=IF(AND(OR($A1:$A10=""/bin/touch"",$A1:$A10=""/bin/rm""),OR($B1:$B10=""f"",$B1:$B10=""b"")),Selection.EntireRow.Hidden = True,"")


dont know if empty string is the way to give it for the false condition

here is my macro:
Code:

Sub HR()
' Hide rows if conditions match
    Range("A1:C10").Select
End Sub


Please find attached is the excel sheet for further clarification.

thank you for your time.




Simple request for all the gurus he
I have created a sheet that is a template for data input with many rows that are unused. For every row that is unused, a cell in the column V will display "Hide"

Basically, I'm trying to create a button that hides and unhides the unused rows. Ideally one button that toggles between hide and unhide.
If a cell in column V displays "Hide" then hide that entire row.
Before rows are hidden, display "Hide unused rows" on the button and hide rows upon clicking
After rows are hidden, display "Unhide rows" with a command to unhide the unused rows

Any help is appreciated!


I'm a VBA newbie and I'm trying to find out how to hide a range of rows based on multiple conditions. I've looked through several threads and I haven't had much luck. Any help would be appreciated. Here's what I'm trying to do:

If G10 = "Summary Charts", then hide rows 6:9
If G10 = "Selection B", then hide row 9
If G10 = "Selection C", then hide rows 8:9

I have about 7 conditions similar to what is described above.

I want this to be dynamic, since it is based on the selection made within a drop down menu.

I have a Jet Report that I created which works great. After the report is created, it auto-hides any column or row that has a jet function in it to make the report easier to read. What i am trying to do is delete any column or row that has HIDE at the beginning. example below-

A B C D E F G
1 hide hide hide hide hide
2 hide
3
4 hide
5
6
7

After the report is saved, Columns ABCEF are hidden, but still there, i don't need this data any longer and would like to remove it from the document without affecting the original excel document.

any suggestions?


Dummy Worksheet Attached

I have a toggle button that scrolls through 1 to 4 levels of detail for the above sheet. I want to hide rows based on the toggle button value (linked to Cell A1) and the value in Column H.

Criteria a

A1 = 1 Hide all rows where H doesn't = 1 or ""
A1 = 2 Hide all rows where H doesn't = 2 0r ""
A1 = 3 Hide all rows where H doesn't = 3 0r ""
A1 = 4 Hide all rows where H doesn't = 4 0r ""

I also want to hide rows where the value in Column M = 0.

I did manage to write something that I thought would work, but it got hideously stuck in a loop. I want the code to run as quickly as possible, I know if I work it out that it won't.

Column H contains numbers until it gets to the first row that doesn't need to be hidden, then column H contains "". An efficient solution would work from this cell upwards I think.

Hope you can help!

Cheers




Hi all,

I have a kind of challenge (well, for me it's a challenge... )

What i want is a VBA script (if neccessary) that automaticly hides rows when a particular value is entered in a cell.

For example:
In sheet1, cell c1 is where the value has to be put in (001, 002, 003 etc.). In sheet 2 i made some sort of database.

Activity-Selection
001-1 (hide row 3, 4 and 5)
002-2 (hide row 5, 6 and 7)
003-3 (hide nothing)
004-1 (hide row 3, 4 and 5)

Selection is the kind of trigger that would autohide the rows.

So all in all.
If i enter "001" in cell c1 in sheet 1, it shoud hide automaticly row 3, 4 and 5.

Please help me Excel Guru's!

Hey everyone, I'm pretty new to the forum so sorry if I leave some details out.

I have created this user form. What is driving me crazy is coding it for multiple conditions.

I've gotten it so that if you were you check off the "Hide Equities Category" you would automatically check off "Hide U.S. Equities Category" and "Hide International Equities Category." But now my issue is that I need it to do the following:

If you were to un-check "Hide Equities Category" you would automatically un-check off "Hide U.S. Equities Category" and "Hide International Equities Category."

If you were to check check off both the "Hide U.S. Equities Category" and "Hide International Equities Category" you would automatically check the "Hide Equities Category."

If you were to check check off the "Hide U.S. Equities Category" and but un-check the "Hide International Equities Category" you would not be able to check the "Hide Equities Category."

If you were to check check off the "Hide International Equities Category" but un-check the "Hide U.S. Equities Category" you would not be able to check the "Hide Equities Category."

Hopefully this paints the picture or what I'm trying to do clearly. You can't have the "Hide Equities Category" checked off if either the "Hide U.S. Equities Category" and "Hide International Equities Category" are not checked and vice versa.

Any help would be greatly appreciated.


I need a macro to hide all the rows except one every 7 days in one button .
But i need quite a help in it.

so far I have this.

Private Sub Hide_Click()
If Hide.Caption = "Hide Columns" Then
Rows("A5:A10").SelectSelection.EntireColumn.Hidden = True
Hide.Caption = "Show rows"
Else
Rows("A5:A10").SelectSelection.EntireColumn.Hidden = False
Hide.Caption = "Hide Columns"
End If
End Sub




Hi,

I'm new in VBA programming.
I have a combo box with 6 options; linked to cel C2
When I choose the first option I would like to hide row 14, 15, 23, 24, 25, 26, 29, 30, 31, 32, 33, 34 and 35.
When I choose the second option I would like to hide row 14, 15, 24, 25, 26, 29, 30, 31, 32, 33, 34 and 35.
When I choose the third option I would like to hide row 15, 25, 26, 34 and 35.
When I choose the forth option I would like to hide row 25, 26, 34 and 35.
When I choose the fifth option I would like to hide row 26, 34 and 35.
When I choose the sixth option I would like to show all.

I did:

'Collateral type'
Private Sub ComboBox1_Change()

Select Case ComboBox1.Value

Dim Rng As Range

Case Is = "1"
Rows("14:15,23:26,29:36").EntireRow.Hidden = True
Case Is = "2"
Rows("14:15,24:26,29:35").EntireRow.Hidden = True
Case Is = "3"
Rows("15:15,25:26,34:35").EntireRow.Hidden = True
Case Is = "4"
Rows("25:26,34:35").EntireRow.Hidden = True
Case Is = "5"
Rows("26:26,34:35").EntireRow.Hidden = True
Case Is = "6"
Rows("11:11,35:35").EntireRow.Unhidden = True

End Select

End Sub

But it didn't work..

Thanks in advance.

I'm making a formulary where 2 people are involved.
It has a few radio buttons. But to make it more clear for the first person I want to hide the rows he doesn't need to fill. However, as I hide the rows, the radio buttons are not hidden and just move upwards.
Is there a way to "fix" the buttons to a cell so that I can hide/unhide them along with the row?
Thanks!!


First, thank you for any help you can give. I'm not the best at creating macros, so I need help with this one.

I have a drop down list in cell I3 with a range of numbers from 0-8. If 0 is selected I want to hide rows 14-69.

If 1 is selected hide rows 21-69
If 2 is selected hide rows 28-69
If 3 is selected hide rows 35-69
If 4 is selected hide rows 42-69
If 5 is selected hide rows 49-69
If 6 is selected hide rows 56-69
If 7 is selected hide rows 63-69
If 8 is selected hide rows No hidden Rows

I also need this macro to work to work it the worksheet is coppied into the same workboob multiple times. Is this possible? Thank you for your help!


I have a growing number of rows of data starting at row 6. The 6th column of any row contains the letter "p" or is blank. I want to hide all the rows with "p" in the 6th column. Then another macro to unhide all hidden rows from row 6 to row 1000.
The following works to hide a specific row:
VB:

If ActiveCell.Offset(0, 5) = "p" Then 
    Rows("6:6").EntireRow.Hidden = True 
    ActiveCell.Offset(1, 0).Range("A1").Select 
End If 


If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines




I am trying to hide rows in a sheet based on a condition in one of the cells in that row. I am using Excel 2010.

I have attached the sheet and am trying to hide all rows which have either "CANCELLED" or "COMPLETE" in column B. This causes 2 problems. Firstly I have tried to use the following code, and just paste it into the editor in Excel VBA, but then, quick as a flash, nothing happens. It may be just me being a VB novice (haven't used it for many, many years), but I just can't get it to run.
VB:

Private Sub Worksheet_Change(ByVal Target As Range) 
     
    If Target.Value = "COMPLETE" Then 
        Target.EntireRow.Hidden = True 
    Else: Target.EntireRow.Hidden = False 
    End If 
     
End Sub 


If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines



The second problem I can foresee is that as most of the cells in the row are merged, it will only hide the upper cell in the merged range (Row 7 in this case) when I want it to hide all 6 rows which are merged, and the 6 rows that aren't merged (but are associated to the merged cells in that row.... sorry, not very clear...) You will see what I mean on the spread sheet hopefully.

The gold standard would be to have a button which you could click to run the macro and hide the rows, then click again (or a second button) to unhide them again...

Any help would be very gratefully received.

A
Conditional Row Hide.xlsx

That works great; however how would you hide multiple rows, or a range
of them?

I tried Rows("2:5").Entirerow.Hidden = True, but it did not work...


On Tue, 22 Feb 2005 18:30:44 +1100, "Steve" <swrtree@hotmail.com>
wrote:

>This hide's a sheet if OK is pressed:
>
>Sub HideSheet()
>Dim hideit
>hideit = MsgBox("Press OK to hide", vbOKCancel, "Hide Test")
>
> If hideit = 1 Then
> Worksheets("Sheet1").Visible = False
> Else
> Worksheets("Sheet1").Visible = True
> End If
>End Sub
>
>
>
>This does the same with Column C
>
>Sub HideCol()
>Dim hideit
>hideit = MsgBox("Press OK to hide", vbOKCancel, "Hide Test")
>
> If hideit = 1 Then
> Columns("C:C").EntireColumn.Hidden = True
> Else
> Columns("C:C").EntireColumn.Hidden = False
> End If
>
>End Sub
>
>HTH
>Steve





Hey there. I'd like to hide all rows below the row of a cell with a given value in it.

Here's what the code does currently:

The first line just unhides everything that was previously hidden.

In cells D2:D5 I have the numbers 2,3,4, and 5 each (2 is in D2, 3 is in D3, etc.). In cell F2, I can type in either 2,3,4, or 5 and then run the macro. If the value in F2 matches the value in any of the cells in column D, the given row will be hidden. For instance, if I typed in "3" into cell F2, row 3 would be hidden. Then, if I typed in "4" into cell F2, row 3 would be unhidden and then row 4 would be hidden.



Please Login or Register  to view this content.


What I want to do though is if I type in "3" in cell F2, it should hide everything BELOW row 3. If I type in "2" in cell F2, it should hide rows 3 and down. Is there a way to do this while keeping the first three lines of the code intact preferably?

Any help would be much appreciated!

Hello. New user here.
I'm having a problem with a simple macro to hide rows. Column A of the rows to be hidden contain check boxes. The macro can hide the rows, no problem, but one check box will not hide. All the other check boxes are hidden, along with their relative row. I've tried changing the format control properties, but nothing seems to work. How do get the macro to hide the check boxes along with the rows??

macro to hide rows:
VB:

Sub Hide_other_elec() 
    Rows("37:68").Hidden = True 
End Sub 
Sub Unhide_other_elec() 
    Rows("37:68").Hidden = False 
End Sub 


If you like these VB formatting tags please consider sponsoring me in support of injured Royal Marines



Thank you!

There it is again:
This one to hide rows with "info" in column B:

Dim cell As Range
For Each cell In Range("B:B")
If cell = "i" Then Rows(cell.Row).Hidden = True
Next

(Work fine...)

And this one to show them back:

Rows("1:100").Select
Selection.EntireRow.Hidden = False

However, the "show all" button doesn't work once I hit the "hide info" button...

Please help! Can any1 tell me why?


Hi,
I'm a beginner and need some help....

How would I write a macro to hide a range of rows If a cell value is zero, then do the same for five additional ranges of rows?

In my words:
If AT214=0, hide rows 214 to 244
and
If AT245=0, hide rows 245 to 278
and
If AT279=0, hide rows 279 to 311
and
If AT312=0, hide rows 312 to 344
and
If AT345=0, hide rows 345 to 377
and
If AT378=0, hide rows 378 to 410

Any help to put me on the right path would be greatly appreciated!
Ben
Brisbane Austraila


Hi - the VBA code was originally written to hide any rows that had HIDE in in Column A. I want to adapt it to hide any columns where the word HIDE appears in Row 2 for that particular column. I've changed the obvious already i.e EntireRow.Hidden changed to EntireColumn.Hidden but I can't figure out how to get it to read across rather than down one particular column- does this make sense?


Sub HideSummaries()



Dim myRange As Range
Dim xlInitialCalcState As XlCalculation

With Application
.ScreenUpdating = False
xlInitialCalcState = .Calculation
.Calculation = xlCalculationManual

For Each myRange In Columns(1).SpecialCells(xlCellTypeConstants)
With myRange
If .Value = "HIDE" Then .EntireColumn.Hidden = True
End With
Next myRange

.Calculation = xlInitialCalcState
.ScreenUpdating = True


End With


End Sub

Thanks

Mark


I have a VBA function that's running very slowly, and I'm looking for suggestions as to how to improve it. The context is that the sheet has multiple sets of rows called 'components', and this function is walking through them determining which ones should be visible and which should be hidden

Here's my (probably naive) implementation:

Code:

Sub tasks_update_component_visibility()
    Dim rowIdx As Long
    
    For rowIdx = 1 To ActiveSheet.UsedRange.Rows.Count Step 1
        If Cells(rowIdx, "A").Value = "%Start" Then
            Dim hide, enable, isHidden As Boolean
            hide = Not Cells(rowIdx, ComponentShownColumnName).Value
            disable = Not Cells(rowIdx, ComponentEnabledColumnName).Value
            isHidden = Rows(rowIdx).EntireRow.Hidden
            
            Rem If we're hidden now and we shouldn't be, we need to reset the
            Rem component's contents before we show it
            If isHidden And Not hide Then
                reset_component (rowIdx)
            End If
            
            Rem Now hide or show the component appropriately
            If (disable And Not isHidden) Or (hide <> isHidden) Then
                rowIdx = hide_or_show_component(rowIdx, hide, disable)
            End If
        End If
    Next rowIdx
End Sub


I don't think the implementation of reset_component or hide_or_show_component matters much, but I'll post them if they might.

Anybody have any suggestions?

Thanks,
Aaron


I've come close to finding the answer, but seem to keep falling short. Here's what I'm trying to accomplish:

Column A (rows 14-35) will contain either "Y" or "N" or no response.
If a user selects "N", I want the row to be automatically hidden.

Autofilter doesn't "automatically" hide the row. I need to "reset" the autofilter and redefine the conditions in order for autofilter to hide the rows. I want the rows to be hidden instantly.

Any way to accomplish this? Thanks...


I have to make a list of people who will be getting charity baskets from our organization

I first list people who are nominated on sheet 1
on sheet 2 I mark with an "X" in column A if they will not be getting a basket

Sheet 3 picks up anyone who does not have an X in column A
The rows with in "X" on sheet 2 will be blank on sheet 3 (actually have a formula putting "" into any cell with an "X" in column A of sheet 2

On sheet 4 I want those blank rows to be hidden

I know, I probably have unnecessary sheets on this spreadsheet, but I want each step to be documented as to what occured.

Is there anyway to do this?

I will be making mailing labels from the list---either I hide the blank rows, or get quite a few blank mailing labels after I merge

thank you for your help




If A1 is also found below A1 (A2,A3,etc) then "HIDE" otherwise "DON'T HIDE"

I want to create a formula which finds out if a value exists below it in the same column. I could then use a filter to remove rows contain the word "HIDE" which will leave me with only rows with DON't HIDE. Then Column A will only contain unique values.

How would I create a formula like this?

Currently, I have over a hundred worksheets that I first unhide all rows and then call the Hide_Rows_Script see example code below (in column 20 I sum all numbers in row if (total=0) then I hide if not I don't hide) so the key to hide or not is if total=0 in row then hide. Hope this makes sense. This works fine except it takes a few minutes to run. I would like to get it running quicker -- is there a way to select the 0 zero rows without running a loop to find them? Looking for a quicker code for this? Thanks.

Worksheet wx4 example:
a1=1 b1=1 t1(column 20) = 2 -- don't hide row
a2=0 b1=0 t1(column 20) = 0 -- hide row
a3=2 b1=2 t1(column 20) = 4 -- don't hide row


Sub hiderow()
'This macro evaluates lines to determine rows to be hidden
Sheets("wx4").Select
' Unhide rows
Rows("6:200").Select
Selection.EntireRow.Hidden = False
'Call hide rows script to hide rows, parms are for x(row) and y(column) values
Hide_Rows_Script 6, 20
end sub

Sub Hide_Rows_Script(x As Single, y As Single)
'This routine will loop through row and hide zeros
Cells(x, y).Select
Do While Cells(x, y).Value ""
' Hide rows
If Cells(x, y).Value = 0 Then
Rows(x).Select
Selection.EntireRow.Hidden = True
End If
' Increment to next row
x = x + 1
Loop
End Sub