IF * then Hide entire Row

mmmarty

Board Regular
Joined
Oct 23, 2004
Messages
79
Greetings,

I've searched the forum to no avail.
I'd like to create a macro to function same as a multiple selection grouping - But this feature does not work in excel right.

I want to place an asterisk * in any cell down the A column, Then have all rows with an asterisk found to be selected and hidden. This must be doable, your suggestion is appreciated.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You could try using Auto filter, that way it can hide the complete row if a '*' is found
 
Upvote 0
Hi

Sure - something like:

Code:
For i =  1 to Cells(Rows.Count,"A").End(xlUp).Row
If Cells(i,1).Value = "*" Then Rows(i).Hidden = True
Next
 
Upvote 0
Thanks Richard, it works.



Sub Hide_Row()
For A = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(A, 1).Value = "*" Then Rows(A).Hidden = True
Next
MsgBox "All rows with an * in Column A have been hidden."
End Sub


Can you tell me why my attempt to UNhide those same rows is failing here?


Sub UNHide_Row()
For A = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(A, 1).Value = "*" Then Rows(A).UNHide_Row = True
Next
MsgBox "All rows with an * in Column A are Un Hidden"
End Sub
 
Upvote 0
Hi

Just wrong property name (and missing Next):

Rich (BB code):
Sub UNHide_Row()
For A = 1 To Cells(Rows.Count, "A").End(xlUp).Row
If Cells(A, 1).Value = "*" Then Rows(A).Hidden= False
Next
MsgBox "All rows with an * in Column A are Un Hidden"
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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