• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Unable to figure out issue in macro

Sub Manish()

'Keyboard Shortcut: Ctrl+m


Rows("5.5").Select

Selection.AutoFilter

End Sub


Hi this is very simple macro I have written. Filter is getting displayed in 6th row instead of 5

Where as IF i write

Rows("4.4").Filter is displayed in 4th row


I am testing the above formula in blank worksheet of excel 2007 version
 
Agrawal


A couple of points


I don't think it is good practice to apply an Autofilter to an entire row, I'd be more selective


What data is in Rows 4, 5 & 6?
 
Double-check, do you have "5.5" or "5:5"? The latter indicates rows 5 through 5, the former gets rounded up to 6. Similarly, 4.4 would get rounded down to just 4.

On my computer, running 2007, the whole thing errors out if I try to run this on a blank worksheet as there are no headers for the filter to be applied to. =/
 
Back
Top