# IF * then Hide entire Row

#### mmmarty

##### Board Regular
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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a \$25,000 loan, 5% annual interest, 60 month loan.

#### Pauljj

##### Well-known Member
You could try using Auto filter, that way it can hide the complete row if a '*' is found

#### Richard Schollar

##### MrExcel MVP
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``````

#### mmmarty

##### Board Regular
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

#### Richard Schollar

##### MrExcel MVP
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``````

Replies
0
Views
553
Replies
0
Views
366
Replies
0
Views
546
Replies
0
Views
353
Replies
1
Views
401

1,190,808
Messages
5,983,038
Members
439,815
Latest member
yoswosz

### 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.

### Which adblocker are you using?

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

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