Hide Row If Question

donjamin

New Member
Joined
Apr 27, 2011
Messages
49
I need a macro or formula that would hide a row in the event that the following would be true:

I2=H2

and repeat to I3=H3 and so on.

all the way down to Row 731.. Also how would i go about unhiding to view later?

If possible. I really appreciate any help.

Thanks
 
Last edited:

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Welcome to the board.
Try:
Code:
Sub quack()
 
Dim i as Long
 
Application.ScreenUpdating = False
 
For i = 2 to Range("I" & Rows.Count).End(xlUp).Row
  If Range("I" & i) = Range("H" & i) Then Rows.(i).EntireRow.Hidden = True
Next i
 
Application.ScreenUpdating = True
 
End Sub
 
Upvote 0
I have a feeling I'm not entering it correctly, so if someone can shed some light it'd be appreciated!
 
Upvote 0
Put this in any empty column in row 2 and then copy it down the column. For this example, say that coulmn is column J and you put it in cell J2 on down

=I2=H2

The formulas will return TRUE or FALSE

  • Select column J
  • Select from the menu Data\Filter\Autofilter
  • That will put a dropdown list in cell J1
  • Select from The J1 dropdown list FALSE
  • That will hide all the rows where I = H
 
Upvote 0

Forum statistics

Threads
1,224,521
Messages
6,179,280
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top