Results 1 to 4 of 4

Assign Match result to a variable

Threaded View

  1. #1
    Registered User
    Join Date
    04-03-2020
    Location
    Belfast
    MS-Off Ver
    2016
    Posts
    2

    Smile Assign Match result to a variable

    Hi all,

    I am trying to assign the result of a match function to a variable, as I will need to use it several times and don't want to run the function repeatedly.

    I thought the below code would do this, but I receive the Run-time error '438' : Object doesn't support this property or method.

    code:

    For i = 2 To LastRow
    rownum = Application.WorksheetFunction.Match(Worksheets(Sheet_Name) & "'!J" & i, "All Codes'!B:B", 0)
    Next i
    Any suggestions will be appreciated! Thanks
    Last edited by Pepe Le Mokko; 04-03-2020 at 10:01 AM. Reason: Tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] User defined type: assign a variable to another variable
    By BNCOXUK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-05-2019, 10:51 AM
  2. Setting variable equal to match result- error 2042
    By Feethurt in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2019, 03:21 PM
  3. [SOLVED] How to extract a piece of a string variable, and assign to a new variable
    By jmccoughlin in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2015, 11:50 PM
  4. [SOLVED] Assign entire row to variable, how do you paste variable values in a new workbook?
    By tv69 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2013, 08:01 PM
  5. Replies: 3
    Last Post: 04-23-2013, 03:46 PM
  6. assign the result of countif to a variable in VBA
    By lima in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-22-2010, 05:19 PM
  7. Assign a SQL Query result to a VB Variable
    By olobraecky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-24-2007, 08:45 AM

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