+ Reply to Thread
Results 1 to 2 of 2

errors with Worksheets object

  1. #1
    Registered User
    Join Date
    09-30-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    78

    errors with Worksheets object

    have a line of code that sets the reference for a range:

    Please Login or Register  to view this content.
    This works without error. However I would like to set this reference for a range on a specific sheet, Sheet2, or "Sales". When I add the worksheets object I get errors, shown below.

    Please Login or Register  to view this content.
    Run-time error '1004': Application-defined or object-defined error

    Please Login or Register  to view this content.
    Run-time error '13': Type mismatch

  2. #2
    Registered User
    Join Date
    09-14-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    2013
    Posts
    4

    Re: errors with Worksheets object

    Hi bsapaka,

    I am new to VBA and this forum. Not sure if my comments below help but you could have a try :

    For Run-time error '1004': Application-defined or object-defined error, I believe there will be a crash to your range "salesHeader" if you run the code to your worksheet "Sales". Instead, probably you may replace as below :
    Please Login or Register  to view this content.
    For Run-time error '13': Type mismatch , I guess you could just simply add the " " to your sheet name as below :
    Please Login or Register  to view this content.
    Hope these are able to help.

    Cheers,
    Leong

+ 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. [SOLVED] Check Err.Number for all errors except 0 and 360 (object already loaded)
    By SandPounder1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-11-2014, 03:53 PM
  2. [SOLVED] Simple loop to filter and copy: object and other errors
    By Dunctonsteel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-12-2012, 10:45 AM
  3. Replies: 5
    Last Post: 09-03-2011, 05:38 PM
  4. [SOLVED] Shell Object Not Working Right In XL2000, But No Errors
    By MDW in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-17-2006, 11:20 PM
  5. Sumif with multiple worksheets-getting #value errors
    By Cbh35711 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-09-2005, 10:05 AM

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