Extract range has missing or invalid field name.

KrisK551

New Member
Joined
Mar 26, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Any idea on how to fix this error. When updating my master page across the sheets I get the error saying:
Run-time error '1004':
The extract range has a missing or invalid field name.

( the red text below is the one highlighted as the issue)

Sub FilterRefresh()
'
' FilterRefresh Macro
'


Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store1"), CopyToRange:=Range("'1803'!Extract"), Unique:=False


Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store2"), CopyToRange:=Range("'1808'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store3"), CopyToRange:=Range("'1810'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store4"), CopyToRange:=Range("'4714'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store5"), CopyToRange:=Range("'4719'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store6"), CopyToRange:=Range("'4732'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store7"), CopyToRange:=Range("'4735'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store8"), CopyToRange:=Range("'4743'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store9"), CopyToRange:=Range("'4748'!Extract"), Unique:=False

Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range( _
"Store10"), CopyToRange:=Range("'8966'!Extract"), Unique:=False

End Sub
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
From the message, I'm guessing that one of the ranges you are trying to use is not valid. Try to see which one.
VBA Code:
Sub FilterRangeTest()

    Dim R As Range

    On Error Resume Next
    Set R = Range("Master")

    If R Is Nothing Then
        MsgBox "Range 'Master' is not a valid range", vbOKOnly Or vbCritical, Application.Name
    Else
        Set R = Nothing
    End If

    Set R = Range("Store1")

    If R Is Nothing Then
        MsgBox "Range 'Store1' is not a valid range", vbOKOnly Or vbCritical, Application.Name
    Else
        Set R = Nothing
    End If

    Set R = Range("'1803'!Extract")

    If R Is Nothing Then
        MsgBox "Range '1803'!Extract is not a valid range", vbOKOnly Or vbCritical, Application.Name
        Exit Sub
    End If
    On Error GoTo 0

    Range("MASTER").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("Store1"), CopyToRange:=Range("'1803'!Extract"), Unique:=False
End Sub
 
Upvote 0
That's the one I would have guessed
 
Upvote 0
Where is Range("'1808'!Extract") supposed to be found?
(Workbook name, worksheet name, range of cells)
 
Upvote 0
1585250082712.png
1585250082712.png
1585250142327.png
1585250108415.png


I enter the info on the master sheet. then i can use the update button to update each individual sheet
only 1803 does not work. now none of it updates since i ran the sub test
 
Upvote 0
From the runtime error and your subsequent test you know the problem is something to do with Range("'1803'!Extract). You must investigate and determine the validity of the ranges you are trying to use. Is it in the right place on the right sheet? Does it contain the expected value? Was the named range "Extract" accidentally deleted or does it contain a bad reference? That kind of thing.
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,618
Members
449,092
Latest member
amyap

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