Macro for Advanced Filter stops before end

cesardltr

New Member
Joined
Sep 26, 2014
Messages
7
Code:
Sub AdvFilter()'
' AdvFilter Macro
'
' Acceso directo: Ctrl+Mayús+F
'
    ActiveSheet.Unprotect
    Application.Goto Reference:="Home"
    Range("B4").Select
    Range("Sort").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
        Range("Crit"), Unique:=False
    Application.Goto Reference:="Home"
    Application.Goto Reference:="Next"
    ActiveSheet.Protect AllowFormattingCells:=True
End Sub

which works fine up to the filter, but doesnot do the Application.Goto Reference:="Home" and subsequent instructions.

¿What am I missing?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Thank you Venkat. Didn't work. Behavior is exactly the same: After running the macro the active cells becomes the first in the filter and then it stops.

Yes, HOME AND NEXT are named cells.

TRY THIS

Code:
application.Goto  RANGE("HOME")

I presume HOME is a range name
 
Upvote 0
not clear. are these ranges within (within) the filtered data.

anyhow post a small extract of data and also indicate output of the macro.
 
Upvote 0

Forum statistics

Threads
1,216,583
Messages
6,131,557
Members
449,655
Latest member
Anil K Sonawane

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