+ Reply to Thread
Results 1 to 4 of 4

Runtime Error for VBA

  1. #1
    Registered User
    Join Date
    12-19-2018
    Location
    Jakarta
    MS-Off Ver
    Microsoft Office 2016
    Posts
    10

    Runtime Error for VBA

    Greetings VBA Guru's

    a little bit stuck here with my VBA's, that every time I select data through EDIT button excel shown runtime error [I attached the file in this post], I tried everything but it does not work, please help me...

    thank you.
    Ardi
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Runtime Error for VBA

    Put 'Option Explicit' at the head of your code.
    Define all variables.
    You appear to have a variable that cannot find a value.

  3. #3
    Registered User
    Join Date
    12-19-2018
    Location
    Jakarta
    MS-Off Ver
    Microsoft Office 2016
    Posts
    10

    Re: Runtime Error for VBA

    Hi Torachan,

    I've put the 'Option Explicit' at the head of my code, yet the problems remain the same, here's the code:

    Please Login or Register  to view this content.

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Runtime Error for VBA

    When using Application.Match you need to declare your variable TargetRow as Variant because it must be able to hold an errorcode (when no match is found) as well as an integer.

    After that you use IsError to determine the value of the variable.

    Can't open References because it's protected.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. VBA error: runtime error 1004 : Method range of object - 'Global' failed.
    By Afjio12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2019, 04:37 AM
  2. [SOLVED] Mac throwing error - Runtime Error 429 - ActiveX Component Can't Create Object
    By harman83 in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-28-2018, 11:04 PM
  3. Runtime error 1004 & runtime error 424
    By MrWhiskey in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-29-2017, 08:57 AM
  4. Runtime error '1004': Paste special method of range class error.
    By Daryl Zer0 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-05-2014, 01:44 AM
  5. [SOLVED] VBA Error: Runtime Error 1004: AutoFilter method of Range class failed
    By jl22stac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2013, 07:27 PM
  6. runtime error 3265 error in a VBA Query to pull info from ERP Database
    By NBVC in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-12-2010, 03:59 PM
  7. 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

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