+ Reply to Thread
Results 1 to 4 of 4

VBA error

  1. #1
    Registered User
    Join Date
    03-08-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    28

    VBA error

    Hi,

    I am running a report and get this error

    Run-time error 1004: Application-defined or object-defined error

    Takes me to the line .Offset(i, 4).Value = .Offset(i, 3).Value - .Offset(i, 2).Value in my VBA function that is
    Please Login or Register  to view this content.
    Firstly, how do I start debugging based off of that error? It seems super general. Secondly, how can you get an error from Offsets? Isn't it just moving around in the cells and subtracting?

    Where should I look for the source of the error? Thanks.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,523

    Re: VBA error

    Does that line of code get a value?

    What is the code supposed to do?
    Last edited by davesexcel; 05-01-2012 at 08:50 PM.

  3. #3
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: VBA error

    If the range
    Please Login or Register  to view this content.
    is a series of cells (as opposed to being a reference to one cell), then each offset:
    Please Login or Register  to view this content.
    will be a range with the same number of rows and columns as the original Range("avgStart").

  4. #4
    Registered User
    Join Date
    03-08-2011
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    28

    Re: VBA error

    Hey Dave or steven, can I send you the excel sheet via email? I'd rather not post it publicly. If you want, you can email me fred2028@gmail.com so I can have your email. Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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