Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Runtime Error 1004

  1. #1
    New Member
    Join Date
    Jan 2010
    Location
    Hoschton, GA
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Runtime Error 1004

    I receive an error when running a recorded macro that I don't know how to fix. The macro copies data into a named worksheet then I use CTL 'T' to format the copied data as a table (allowing user to sort/filter as needed). When I run the macro I receive the error;

    Run-time error '1004':
    A table cannot overlap another table.

    I believe it is seeing the table format as being already there from using the CTL 'T' during recording. It identified the table as "Table3" during setup but subsequent runs assign a sequential number so it does recognize the "Table3" name.

    Anyone know a fix around this?

    [code]
    ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$7:$AH$107"), , xlYes).Name = _
    "Table3"
    Range("Table3[#All]").Select
    [code]

    Once I have this figured out I am going to ask if there is a way to have the macro run a loop that checks to see if there is a blank in the cell of the first column and if so delete that row and continue checking for 100 rows. I would want to do this immediately prior to formatting the data as a table (the copied data may or may not have data in each row).

  2. #2
    New Member cshivers's Avatar
    Join Date
    Mar 2010
    Location
    Kansas
    Posts
    34
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Runtime Error 1004

    If you import it then format it as a table once this will work. But if you are trying to import data every time it loads you will have to delete the table 3 before creating it again.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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