+ Reply to Thread
Results 1 to 7 of 7

Method or data member not found

  1. #1
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Method or data member not found

    I am getting the following error message from the below code "Method or data member not found"

    Please Login or Register  to view this content.
    When I select OK the first .vRes is highlighted. I have checked the names on the txt and cbo boxes and these are correct. Can anyone tell me what is causing this problem?

    Thanks

    Katie

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Method or data member not found

    Hi, Kartie,

    what is .vRes? IŽd expected .Value or .Text for Textboxes. And maybe you should use WorksheetFunction instead of Application.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Method or data member not found

    Hi Holgar,

    If I am honest I am not sure what v.Res is. I posted last week as this is to autopopluate cells based on the selection in cbo_CmpName and I was told the error was due to the code getting an empty cell from the VLOOKUP.

    Please can you explain the worksheet function, I am very new to this so unfortunately have very limited knowledge.

    Thanks

    Katie

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Method or data member not found

    Hi, Katie,

    I posted last week as this is to autopopluate cells based on the selection in cbo_CmpName and I was told the error was due to the code getting an empty cell from the VLOOKUP.
    A link to that thread would have been helpfull.

    If the person who delivered the answer has the same basic naming as I vRes is the result of the VLookUp and would either hold the value if the item is found or an Error.

    AFAIK there is no VLookUp for teh Excel application but only the function that can be used as a WorksheetFunction. You could get help about the parameters on the OnlineHelp.

    Your code needs to be restructured like this:

    Please Login or Register  to view this content.
    You could consider to work with a loop and arrays for holding the Columns as well as the ControlNames.

    Ciao,
    Holger

  5. #5
    Forum Contributor
    Join Date
    02-24-2013
    Location
    Dubai, UAE
    MS-Off Ver
    Excel 2013
    Posts
    113

    Re: Method or data member not found

    Thank you so much for taking the time to help Holger.

    I have tried the above code and I am not getting an error of

    "Run-time error 9, Subscript out of range"

    Do you know what may be causing this? Sorry for all the questions.

    Katie

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Method or data member not found

    Hi, Katie,

    without seeing the file it could be either the path to the workbook or missing or misspelled control be the issue.

    Ciao,
    Holger

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Method or data member not found

    Try this.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

+ 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. [SOLVED] error: Method or Data Member not found
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-26-2013, 11:01 AM
  2. [SOLVED] Compile error: Method or data member not found.
    By ndtsteve in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-10-2012, 11:31 AM
  3. Compile Error:Method or Data Member Not Found
    By loknath in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-29-2012, 04:03 AM
  4. Compile Error Method or data member not found
    By ExcelMonkey in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-04-2005, 06:05 PM
  5. Method or Data Member not Found
    By Syed Haider Ali in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-22-2005, 09:27 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