Results 1 to 14 of 14

extract range has a missing or illegal field name

Threaded View

  1. #12
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    365 Version 2409
    Posts
    2,789

    Re: extract range has a missing or illegal field name

    I reused some of Jindon's code so hopefully it works the first time.
    If you have any problems copy and paste the line of code that errors, it will be the one highlighted in yellow.
    Try this on a copy.

    Sub ImportWorksheets()
    Dim ws As Worksheet, a, i As Long, myName As String, dic As Object, arrFiles, j, wbSrc As Workbook
    Application.ScreenUpdating = False
        Set dic = CreateObject("Scripting.Dictionary")
          With Sheets("sheet1").Cells(1).CurrentRegion
            a = .Columns("g").Value
            For i = 2 To UBound(a, 1)
                If Not dic.exists(a(i, 1)) Then
                    dic(a(i, 1)) = a(i, 1) & "_" & Split(.Cells(i, 6).Value, ",")(0) & ".xlsx"
                End If
            Next
            arrFiles = dic.items()
            For Each j In arrFiles
                If Dir(ThisWorkbook.Path & "\" & j) <> "" Then
                    Set wbSrc = Workbooks.Open(ThisWorkbook.Path & "\" & j)
                    wbSrc.Worksheets(1).Copy After:=ThisWorkbook.Worksheets(ThisWorkbook.Worksheets.Count)
                    wbSrc.Close
                End If
            Next j
        End With
    Application.ScreenUpdating = True
    End Sub
    Last edited by skywriter; 10-08-2015 at 04:59 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Missing Text In Mail Merged Field
    By adil.master in forum Word Formatting & General
    Replies: 2
    Last Post: 03-10-2014, 08:34 AM
  2. Validation list (with illegal characters in the range list)
    By Elainefish in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-04-2013, 04:38 PM
  3. Extract a date from a field and append another field's data
    By Leroy221 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-07-2012, 11:35 AM
  4. Error: THE EXTRACT RANGE HAS A MISSING OR ILLEGAL FIELD NAME
    By Min22 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2012, 03:40 PM
  5. Keep getting an Range Missing or Illegal Field name error
    By dwhite30518 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-09-2012, 07:07 PM
  6. Advanced Filtering Extract Range Missing,etc
    By bridges_22 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-06-2006, 12:19 PM
  7. [SOLVED] illegal field name using advanced filters after inserting a row
    By tron527 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2005, 11:05 PM
  8. [SOLVED] missing or ill egal extract range advanced filter
    By tjtjjtjt in forum Excel General
    Replies: 3
    Last Post: 07-10-2005, 06:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1