+ Reply to Thread
Results 1 to 9 of 9

Excel Macro works in excel 2013, but not working in Excel 365

  1. #1
    Registered User
    Join Date
    01-20-2016
    Location
    Indiana
    MS-Off Ver
    2013
    Posts
    45

    Excel Macro works in excel 2013, but not working in Excel 365

    My company is upgrading to Office 365 and one of my excel databases that is loaded with macros is not functioning properly. The section in Red is where I am getting the error.

    I am getting Run-time error '1004':
    The extract range has a missing or invalid filed name

    This macro works great in the older version. Any help? I can include database if that would be helpful.


    Sub MultiplePage3Creation()
    Dim rws As Long, i As Long
    rws = Application.InputBox("Enter last Row Number to which you have Data (Number in Column O).", "COPY TO ROW NUMBER", Type:=1)
    If rws = vbCancel Then Exit Sub
    For i = 4 To rws
    Sheets("Library").Range("P" & i).Copy
    Sheets("PLANTALL").Range("BV2").PasteSpecial Paste:=xlPasteValues
    Sheets("Library").Range("Q" & i).Copy
    Sheets("PLANTALL").Range("BW2").PasteSpecial Paste:=xlPasteValues
    Sheets("Library").Range("R" & i).Copy
    Sheets("PLANTALL").Range("CB2").PasteSpecial Paste:=xlPasteValues
    Sheets("Library").Range("S" & i).Copy
    Sheets("PLANTALL").Range("BZ2").PasteSpecial Paste:=xlPasteValues
    Application.CutCopyMode = False
    Range("A1:BR100000").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:= _
    Range("BU1:EM2"), CopyToRange:=Range("BU22:EM22"), Unique:=False


    Sheets("Sample Summary").Select
    Dim strDataRange As Range
    Dim keyRange As Range
    Set strDataRange = Range("A16:O68")
    Set keyRange = Range("O16")
    strDataRange.Sort Key1:=keyRange, Order1:=xlDescending

    Range("A1:O69").Select
    Selection.Copy
    Sheets("Sheet1").Select
    Selection.PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
    , SkipBlanks:=False, Transpose:=False
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False


    Range("A" & Rows.Count).End(xlUp).Offset(1).Select
    Next

    End Sub

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    1,514

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    What is the name of the worksheet with these ranges?
    Please Login or Register  to view this content.
    ____________________________________________________________
    If I've been helpful, let me know. If I haven't, let me know that too.

  3. #3
    Registered User
    Join Date
    01-20-2016
    Location
    Indiana
    MS-Off Ver
    2013
    Posts
    45

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    PLANTALL is the worksheet name

  4. #4
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    UK
    MS-Off Ver
    2016 primarily
    Posts
    4,717

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    Quote Originally Posted by tsdpurdue View Post
    I can include database if that would be helpful.
    I suspect it would.
    Rory
    Yea though I walk through the valley of the shadow of death, at least it's a change of scenery

  5. #5
    Registered User
    Join Date
    01-20-2016
    Location
    Indiana
    MS-Off Ver
    2013
    Posts
    45

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    I was not able to upload the database. It was too large even after deleting most of the data in it. I have attached a copy of the PLANTALL page. This is where the macro is trying to pull the data from.

    As you can see the macro (Code in original post) is just a way to loop an advanced filter. The 1st part of macro allows me to enter the number of loops i want it to make. Then the criteria is pasted into the criteria portion of the advanced filter and then a summary is created.

    Thanks for looking into this for me!

    Tyler
    Attached Files Attached Files

  6. #6
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    1,514

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    Your worksheet only has 65,536 rows. Try changing
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-20-2016
    Location
    Indiana
    MS-Off Ver
    2013
    Posts
    45

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    I made the change and still got the same error message. I have included a screen shot of the error message and what i see when i check Debug
    Attached Images Attached Images

  8. #8
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    1,514

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    Try this...
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    01-20-2016
    Location
    Indiana
    MS-Off Ver
    2013
    Posts
    45

    Re: Excel Macro works in excel 2013, but not working in Excel 365

    So far this seems to be working! I will continue to test! Thank you so much!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro works in Excel 2007 but not in Excel 2013
    By DJvdW in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2017, 05:38 AM
  2. Macro works under Excel 2010 but not Excel 2013
    By Carrfamily in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2017, 07:08 AM
  3. [SOLVED] Data Export Macro works in Excel 2013 but not Excel 2007
    By margentieri in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-27-2016, 10:49 AM
  4. Macro that works in Excel 2010 does not work in Excel 2013
    By karenmwhaley in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-12-2016, 08:12 PM
  5. [SOLVED] Macro to move a row works in excel 2010 but not in Excel 2013
    By mmccra2858 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2015, 05:07 PM
  6. VBA formatting macro that worked in Excel 2010 is not working correctly in Excel 2013
    By jayar2112 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2015, 01:14 PM
  7. Replies: 4
    Last Post: 04-10-2014, 12:11 PM

Tags for this Thread

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