automatically hiding a row

Mattlake

Board Regular
Joined
Apr 9, 2020
Messages
91
Office Version
  1. 2021
Platform
  1. Windows
HI

I hope you can help, I have been looking online and either I dont have the feature or i cannot do it.

I have a table Column B to F and I want to hide the row if column F shows the word Completed.

I have looked at conditional formatting but cannot find how to hide, not even sure where to start on VBA/macros

Is this possible?

Regards

Matthew (always confused)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You could simply manually filter the data based on column F not equal to "Completed". If you need a macro to do this, please advise.
 
Upvote 0
Thanks I was thinking i had made this too complicated and a simple approch would be easier.

Regars
 
Upvote 0
Try.
VBA Code:
Sub HideRows()
Dim Lr&, T&, S$
Dim M
Lr = Range("F" & Rows.Count).End(xlUp).Row
M = Filter(Evaluate("transpose(IF(F2:F" & Lr & "=""Completed"",""A""&row(F2:F" & Lr & "),False))"), False, False)
For T = 0 To UBound(M)
S = S & "," & M(T)
If Len(S) > 240 Or T = UBound(M) Then
Range(Mid(S, 2)).EntireRow.Hidden = True: S = ""
End If
Next T
End Sub
 
Upvote 0
Solution
Thank you.

That works, I think it would be easier to connect it to a button so it runs when i click button 5)
 
Upvote 0
Select Developer-->in controls select Insert
Form Controls--> Button
Mark the button on worksheet
Assign the HideRows macro by selecting in Assign Macro dialogue box.
Edit the text in Button as Hide Rows.
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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