+ Reply to Thread
Results 1 to 5 of 5

Match Function Wont Work in VBA

  1. #1
    Registered User
    Join Date
    04-18-2020
    Location
    QLD, Australia
    MS-Off Ver
    365
    Posts
    5

    Match Function Wont Work in VBA

    can anyone see what is wrong this this code?




    Private Sub CommandButton1_Click()

    Dim RangeTarget As Integer


    RangeTarger = Application.WorksheetFunction.Match(ISS_ID_Menu, Sheets("Data_Master"), Range("Dyn_Date"), 0)

    MsgBox RangeTarget



    End Sub

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,178

    Re: Match Function Wont Work in VBA

    Please insert the code in the code tag, [ code] Your Code [ /code] (or use the # button)

    Try

    Please Login or Register  to view this content.
    Last edited by Phuocam; 04-18-2020 at 08:33 PM.

  3. #3
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Match Function Wont Work in VBA

    Hi Brendan,

    Welcome to the forum!!

    Assuming Phuocam's solution works you've also misspelled your variable when trying to assign a value to it i.e. RangeTarger should be RangeTarget. Using Option Explicit would detect this.

    Thanks,

    Robert
    Last edited by Trebor76; 04-18-2020 at 08:43 PM.
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  4. #4
    Registered User
    Join Date
    04-18-2020
    Location
    QLD, Australia
    MS-Off Ver
    365
    Posts
    5

    Re: Match Function Wont Work in VBA

    Quote Originally Posted by Phuocam View Post
    Please insert the code in the code tag, [ code] Your Code [ /code] (or use the # button)

    Try

    Please Login or Register  to view this content.
    Sorry Phuocam,

    Im very new to VBA, could you give me an example of your suggestion above, I also have recognized that the variable was spelt wrong. I keep getting a
    "complie error"
    "wrong number of arguments or invalid property assignment"

    I thankyou in advance

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Match Function Wont Work in VBA

    Please Login or Register  to view this content.
    Last edited by jindon; 04-18-2020 at 11:55 PM.

+ 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. Index Match multiple criteria wont work, but nested IF's do-partially
    By andrewoz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-17-2016, 02:12 AM
  2. TRIM function WONT WORK
    By danallamas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2014, 12:11 AM
  3. Vlookup value wont work with match function
    By john dalton in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-25-2013, 09:36 AM
  4. AverageIF function.. wont work for me!?
    By Daniel86 in forum Excel General
    Replies: 11
    Last Post: 07-16-2012, 10:02 AM
  5. TODAY Function wont seem to work
    By Sanecrazy in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 03-21-2012, 08:09 AM
  6. sum function wont work in my worksheet
    By mufan in forum Excel General
    Replies: 2
    Last Post: 06-05-2009, 07:48 AM
  7. Function wont work!?
    By Jonas in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-06-2006, 12:30 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