+ Reply to Thread
Results 1 to 2 of 2

Runtime error 1004 Application defined or object defined error

  1. #1
    Registered User
    Join Date
    02-06-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1

    Runtime error 1004 Application defined or object defined error

    I dont know why i am having a lapse in brainwave activity but I cannot figure how to set the variable source worksheet = to the workbook source 1st sheet. I am looking to go into a named file folder and extract data from variable named file folders that each contain .xls files and copy and paste all copied data to the same new worksheet. My code breaks down and throws an error at the same location. If anyone can advise how to reference the first sheet using the set property that would be greatly beneficial. Below is a snippet of my code and the last line is where it breaks
    Please Login or Register  to view this content.
    Last edited by detcityced; 02-06-2018 at 04:00 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Runtime error 1004 Application defined or object defined error

    Hello detcityced,

    The problem is probably in the way you are referencing the worksheet. "Sheets(1)" will return the sheet that is in the first position of all the sheets in the workbook. The Sheets collection includes Charts, Macro sheets , and worksheets. If you want to return a reference to a worksheet named "Sheet1" then you should reference it like this: Worksheets("Sheet1").
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

+ 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. Runtime error 1004 application-defined object-defined
    By stevoDE in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2017, 09:58 AM
  2. Replies: 5
    Last Post: 08-19-2015, 07:10 PM
  3. Replies: 0
    Last Post: 05-14-2012, 11:59 PM
  4. Runtime error 1004 application defined or object defined error
    By Wyliecody in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-03-2012, 12:38 PM
  5. Runtime error '1004' Application-defined or object-defined error Comment
    By Willer in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-17-2011, 03:02 PM
  6. [SOLVED] RE: Runtime error 1004- application defined or object defined erro
    By Novice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-06-2006, 05:40 PM
  7. RE: Runtime error 1004- application defined or object defined erro
    By Jim Thomlinson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2006, 05:35 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