+ Reply to Thread
Results 1 to 10 of 10

Deleting Names From Workbook (VBA)

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    42

    Deleting Names From Workbook (VBA)

    Hello,

    I have a little code as part of a macro that once it arrives starts to delete the names in the workbook one by one.
    This worked a treat for some time, but seems that something has changed and when running returns a runt time error 1004.

    Please Login or Register  to view this content.
    For some reason the code seems to skip setting the nm at line 1, then gets to line 4 and returns the error. If i skip this line and continue onto line 5 the nm is set and then the loop continues without a problem.

    Any body out there that might know where i am going wrong here?

    Thanks in advance!

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Deleting Names From Workbook (VBA)

    Is that the whole code? Works fine for me...

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Deleting Names From Workbook (VBA)

    No not the whole code there is quite a lot before this, from what i can tell when it gets there looking at the locals is that the very first name in the workbook seems to have a problem

    there are 100 odd names in the workbook and the one at index 2 should be the first name as far as i can tellCapture.PNG

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Deleting Names From Workbook (VBA)

    You should post your workbook. It's kind of hard to troubleshoot a picture.
    I see your profile shows your version is 2003, is this correct?
    Notice a couple of lines above where you highlighted, it shows
    Name then _xlfn_Sumifs, what you are highlighting seems to be that you have a sumifs formula and the formula is having a problem, perhaps because of your version?

    Need the workbook.
    Last edited by skywriter; 11-05-2015 at 01:43 PM.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  5. #5
    Registered User
    Join Date
    06-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Deleting Names From Workbook (VBA)

    ok will post now tks.
    Sorry no my version is now 2010... need to update that will get to that in moment.

  6. #6
    Registered User
    Join Date
    06-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Deleting Names From Workbook (VBA)

    data.xlsm
    ok here is the file

  7. #7
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Deleting Names From Workbook (VBA)

    I don't find any names, nor do I find any code creating names.

  8. #8
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Deleting Names From Workbook (VBA)

    You could try
    Please Login or Register  to view this content.
    and see if this works better.

    Alf

  9. #9
    Registered User
    Join Date
    06-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Deleting Names From Workbook (VBA)

    Thanks Alf that has sorted the issue

  10. #10
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Deleting Names From Workbook (VBA)

    You are welcome.

    Thanks for feedback and rep

    Alf

+ 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. Deleting Table Names
    By chelseagardens in forum Excel General
    Replies: 1
    Last Post: 08-26-2013, 10:45 AM
  2. [SOLVED] Copy Values From Each Workbook in Folder to a Single Sheet in New Workbook +Workbook names
    By Arsham24 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-21-2012, 07:42 PM
  3. Finding and deleting a small list of names from a really big list of names
    By vitalstatistix in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-07-2011, 01:31 PM
  4. [SOLVED] deleting names from the name box
    By Amy C in forum Excel General
    Replies: 4
    Last Post: 05-12-2006, 06:10 AM
  5. Deleting names from a spreadsheet
    By bullwinkle55423 in forum Excel General
    Replies: 2
    Last Post: 04-17-2006, 04:30 PM
  6. [SOLVED] deleting duplicate names
    By chris in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-16-2006, 04:50 PM
  7. [SOLVED] Deleting All Range Names
    By Jim in forum Excel General
    Replies: 3
    Last Post: 06-04-2005, 10:05 AM
  8. Deleting unused Defined Names in a workbook?
    By Mike Piazza in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-13-2005, 01:06 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