+ Reply to Thread
Results 1 to 4 of 4

Run-time error 1004 on adding new sheets using unique values

  1. #1
    Registered User
    Join Date
    02-11-2014
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    19

    Run-time error 1004 on adding new sheets using unique values

    I'm trying to set up a macro that will capture all the unique values in a column, and then create a new sheet for each value. What I've got so far technically works, but it's also adding an extraneous sheet (with a generic sheet name, not the specified name I'm giving the sheets) and also giving me "Run-time error '1004': Application-defined or object-defined error" when it runs. I've been Googling like crazy and can't figure out where the error is coming from. I'm guessing it has something to do with naming the sheets, but I'm not sure.

    Please Login or Register  to view this content.
    I've tried playing with the code so that it only runs while c is not null or not empty, but I keep getting errors no matter what I throw in there. Trying to keep it as simple as possible.

  2. #2
    Forum Contributor
    Join Date
    12-09-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    171

    Re: Run-time error 1004 on adding new sheets using unique values

    try this

    Please Login or Register  to view this content.
    Last edited by satabp; 03-05-2014 at 02:13 PM.
    Like my answer, then click * below

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Run-time error 1004 on adding new sheets using unique values

    Which line is highlighted when the error occurs?

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    02-11-2014
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    19

    Re: Run-time error 1004 on adding new sheets using unique values

    Nothing is highlighted when the error occurs on my code, it just brings up that run-time error.

    I changed one thing in your code (Sheet("Sheet1") to ActiveSheet) and it seems to work fine. Thank you so much for your help!

+ 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. Run-time error '1004': Method 'Sheets' of object '_Global' failed
    By stigb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-21-2013, 03:35 PM
  2. [SOLVED] Run-time error 1004 when running Advanced Filter for Unique Values in macro
    By jacobadger in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-17-2012, 02:17 PM
  3. Run time error 1004 when adding rows
    By jpruffle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-28-2009, 07:35 AM
  4. Comparing a string to values in an array resulting in a Run time Error 1004
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-15-2009, 04:21 PM
  5. Error '1004' when adding sheets
    By broncoern in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2007, 04:04 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