+ Reply to Thread
Results 1 to 8 of 8

runtime error in Excel VBA

  1. #1
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    runtime error in Excel VBA

    I would appreciate any assistance to the following VBA that I'm trying to use. Currently I'm getting a runtime error 1004

    Please Login or Register  to view this content.

    I believe the VBA works fine up until the THEN, I think the error is after THEN

    Thank you
    Last edited by alansidman; 11-16-2017 at 02:24 PM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,785

    Re: runtime error in Excel VBA

    Ifna is a worksheet formula and not a VBA formula. If you want to use Ifna in VBA then you will have to preface it with Application.WorksheetFunction. This is also true for the vlookup function.

    Look at this link to ensure an understanding.

    http://www.ozgrid.com/Excel/free-tra...a1lesson18.htm

    http://www.cpearson.com/excel/callin...ionsinvba.aspx
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,379

    Re: runtime error in Excel VBA

    Hi tdf,

    You have:
    Please Login or Register  to view this content.
    I have a problem with the period between $A$1.$B$10000
    I also have a problem with this VLookup as your data is only 2 columns and you want column 3 returned.

    See if that helps first...
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: runtime error in Excel VBA

    In addition to the period/colon issue that Marvin noted, I also noticed that the number of quote marks is wrong
    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    Re: runtime error in Excel VBA

    Quote Originally Posted by MarvinP View Post
    Hi tdf,

    You have:
    Please Login or Register  to view this content.
    I have a problem with the period between $A$1.$B$10000
    I also have a problem with this VLookup as your data is only 2 columns and you want column 3 returned.

    See if that helps first...
    MarvinP, thanks for checking my errors, I should have seen those before posting. However, with the corrections made, I'm still getting a runtime error message. I will have to check further into what Alansidman is posting

  6. #6
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    Re: runtime error in Excel VBA

    Quote Originally Posted by mikerickson View Post
    In addition to the period/colon issue that Marvin noted, I also noticed that the number of quote marks is wrong
    Please Login or Register  to view this content.
    thank you for the suggestion, but I'm still getting a runtime error with this correction

  7. #7
    Forum Expert
    Join Date
    04-01-2013
    Location
    East Auckland
    MS-Off Ver
    Excel 365
    Posts
    1,347

    Re: runtime error in Excel VBA

    So now we assume you ware working with
    Please Login or Register  to view this content.
    right?
    And you have both tabs named correctly as test and pivot1?
    If you want something done right... find a forum and ask an online expert.

    Time flies like an arrow. Fruit flies like a banana.

  8. #8
    Registered User
    Join Date
    01-13-2010
    Location
    Cadillac, MI
    MS-Off Ver
    Excel 2003
    Posts
    81

    Re: runtime error in Excel VBA

    Quote Originally Posted by scottiex View Post
    So now we assume you ware working with
    Please Login or Register  to view this content.
    right?
    And you have both tabs named correctly as test and pivot1?
    thank you. And thanks to all who took the time to read and 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. [SOLVED] runtime error “28” and Excel crashes
    By starlev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2016, 12:17 PM
  2. excel/outlook runtime error 440
    By Spotniq in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-28-2015, 02:57 AM
  3. Excel VBA Runtime 1004 Error
    By darian117 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-04-2012, 01:41 PM
  4. Excel xmlHTTP object error message - system/runtime error
    By Porky2007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 09:36 AM
  5. Runtime Error 1004 Excel 97
    By missfitz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-09-2006, 04:06 AM
  6. Excel 2003 Macro Error - Runtime error 1004
    By Cow in forum Excel General
    Replies: 2
    Last Post: 06-07-2005, 09:05 AM
  7. [SOLVED] Excel 2003 Help Runtime Error
    By Weezay in forum Excel General
    Replies: 1
    Last Post: 01-27-2005, 03:06 PM

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