Results 1 to 10 of 10

Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Macro to delete names - Run-time error '1004', The syntax of this name isn't correct

    I'm having issues with this macro to delete names in the workbook.
    It used to work with Excel 2007 but not with the 365 version.

    Sub Del_Names()
        Dim NameToDelete As Name
        For Each NameToDelete In Application.ActiveWorkbook.Names
            If Right(NameToDelete.Name, 12) <> "Print_Titles" Then
                NameToDelete.Delete
            End If
        Next NameToDelete
    End Sub
    Capture.PNG
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 08-08-2016, 04:35 PM
  2. [SOLVED] Run-time error '1004': Delete method of Range class failed
    By Nobo1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2016, 03:01 AM
  3. Combobox selection / Delete row after saving in another sheet / Run-time error '1004'
    By Arvin.Amaro in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-15-2015, 07:27 PM
  4. Run-time error '1004': Delete method of Range class failed
    By Lozza1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 04:56 PM
  5. [SOLVED] Run-time error '1004' ; Delete method of Range Class failed
    By Adam1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2012, 06:43 AM
  6. Defined Names + Macro = Error 1004
    By ThatGuyNamedRyan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2011, 04:40 PM
  7. Run time error 1004 syntax problem
    By 1eyedjack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2010, 04:51 AM

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