+ Reply to Thread
Results 1 to 7 of 7

VBA If Match Then formula syntax error

  1. #1
    Registered User
    Join Date
    12-01-2017
    Location
    New Jersey
    MS-Off Ver
    2016
    Posts
    63

    VBA If Match Then formula syntax error

    I have a worksheet named BL_OUT_WORKSHEET. I am attemting to match each value in Column I to the last row to the values in a second worksheet named VT11 in Column A. If a match occurs I want to add the text VT11 to the BL_OUT_WORKSHEET coumn E. I am using an If IsNotErrror - Then Syntax
    Here is the code I have currently
    Please Login or Register  to view this content.
    I calculate the last row without error and the Match(Range("I" & r).Value shows a value that equals the value in the first row that I will look to match to. The macro bugs out in the If Not IsError row with a run time code 242. I'm assuming I have a syntax error since it cant find the object. Can you help me correct this or another method

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: VBA If Match Then formula syntax error

    I see a spelling error in your If code. it should be:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA If Match Then formula syntax error


    Hi,

    as using WorksheetFunction leads to a crash when MATCH returns an error so it's better to remove it …

  4. #4
    Registered User
    Join Date
    12-01-2017
    Location
    New Jersey
    MS-Off Ver
    2016
    Posts
    63

    Re: VBA If Match Then formula syntax error

    I now get this error vba runtime error 1004 unable to get the match property of the worksheetfunction class

  5. #5
    Registered User
    Join Date
    12-01-2017
    Location
    New Jersey
    MS-Off Ver
    2016
    Posts
    63

    Re: VBA If Match Then formula syntax error

    Marc L If I remove it how else can I achieve this .

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: VBA If Match Then formula syntax error

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: VBA If Match Then formula syntax error

    Quote Originally Posted by spyac View Post
    Marc L If I remove it how else can I achieve this .
    Like you wrote but this time without any typo …

+ 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. getting #NAME? error but syntax looks OK to me - VLOOKUP & MATCH Issue
    By mAdMaCCa in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-01-2019, 09:40 AM
  2. [SOLVED] syntax error in vba formula
    By dmcgov in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-25-2019, 06:59 AM
  3. [SOLVED] Syntax error for If then Else formula
    By robert26 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-13-2019, 02:53 PM
  4. [SOLVED] Former employees strange match formula syntax
    By j.peel in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-09-2019, 04:52 PM
  5. Index and Match syntax error
    By kocumna in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-14-2018, 03:06 PM
  6. Match formula syntax
    By Traymond in forum Excel General
    Replies: 5
    Last Post: 01-11-2011, 01:37 AM
  7. Error with formula syntax
    By menefist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-28-2005, 03:42 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