AutoFilter isn't working it goes to another row

Sonyafm

New Member
Joined
Mar 3, 2015
Messages
18
Thank you in advance!

I have two issues with Autofilter
1. Autofilter is going to the first row instead of row 8
2. Is not filtering out blanks and/ or cells with formula that results in a "-" o dash
Code:

Sub hideemptyrows2()

Worksheets("Indirect Cost Forecast").Activate


Sheets("Indirect Cost Forecast").Activate
Rows("8:8").Select
Selection.AutoFilter Field:=5, Criteria1:="<>"

End Sub
 
@ MARK58 Yes it works in a brand new excel spreadsheet. @Fluff no merged cells.

Should I create a brand new workbook?

Thank you
Sonya
 
Upvote 0

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
The problem is within the Apply_click event.
You are filtering row 1 but not removing the filter before calling hideemptyrows2.
At the end of the Apply_click code you have
Code:
Cells.AutoFilter
Replace that with
Code:
 Worksheets("Indirect Cost Forecast").AutoFilterMode = False
and you should be ok.
 
Upvote 0
@Fluff, Now the filter is on row 8!!! yay

However, is not filtering out the blanks o the cells that have a "-" ???

Where are the cells with a "-" in column E? and you only have blanks on E30 and E61.

If you mean the cells with 0 then see Fluffs response.
 
Last edited:
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,896
Members
449,194
Latest member
JayEggleton

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