+ 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
    61

    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 2003-2010-2013
    Posts
    2,078

    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
    4,356

    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
    61

    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
    61

    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
    6,362

    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
    4,356

    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)

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