+ Reply to Thread
Results 1 to 11 of 11

Syntax to find the row num of a range of strings

  1. #1
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Syntax to find the row num of a range of strings

    i am trying to find the row num of a range of strings

    i have tried FIND

    Please Login or Register  to view this content.
    i have tried MATCH

    Please Login or Register  to view this content.
    can someone tell me what i am doing wrong?

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Syntax to find the row num of a range of strings

    with find you can use this below code:

    Please Login or Register  to view this content.
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Syntax to find the row num of a range of strings

    than_gold, that doesn't work as the line in my code fails on frow so trying to find frow.row will not work. i need the match line to evaluate to frow.

  4. #4
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Syntax to find the row num of a range of strings

    so can someone write me code as a test?

    i will open up only one workbook
    i will only use sheet1
    in column A1 is "Apple", A2 is "Orange", and A3 is "Banana"

    how can i search for Banana and have it return row 3 as a result. can someone please do that for me?

  5. #5
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Syntax to find the row num of a range of strings

    Pls check with ... end with in your code to restrict to sheet where you wanted to find the row?

    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Syntax to find the row num of a range of strings

    Here you:
    Pls check the file with code, to show msg box of row.
    Attached Files Attached Files

  7. #7
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Syntax to find the row num of a range of strings

    ok, so your code works. but when i put it in my workbook, it fails with the same object message.

    here is my code.

    Please Login or Register  to view this content.
    it errors out on FindRowNumber so let me upload it and see if you can get it working.
    Attached Files Attached Files

  8. #8
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Syntax to find the row num of a range of strings

    so to display hdn_Codes worksheet, goto Mainsheet, select unhide button, type in "master" and then "Password", note that the P is caps. this will display the hdn_Codes table (which is on codesheet sheet1).

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Syntax to find the row num of a range of strings

    You get the error because "Bangalore" does not exist in A1:A4
    Try
    Please Login or Register  to view this content.

  10. #10
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: Syntax to find the row num of a range of strings

    Fluff, your the king. very embarassed that i did not catch this till you pointed it out. by changing the range from a1:a4 to a2:a5 fixed the issue. minus one point for me.

    thanks again.

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,081

    Re: Syntax to find the row num of a range of strings

    You're welcome & thanks for the feedback

+ 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. Find two strings in a range select cells in between and loop through range
    By maxwell13 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-27-2018, 04:04 AM
  2. [SOLVED] Set Range based on FIND of multiple strings
    By delaing in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-14-2016, 12:18 PM
  3. [SOLVED] Using Instr to find duplicate strings in a range. Much pain.
    By Sc0ut in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-08-2015, 09:59 AM
  4. [SOLVED] Correct syntax for function to find average based on background color of cells in range
    By moosetales in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-21-2014, 12:24 AM
  5. Replies: 12
    Last Post: 01-13-2014, 09:34 PM
  6. Find Unique Text Strings in Range
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-28-2011, 10:08 AM
  7. How to find number of pairs of strings from list of strings?
    By greg_overholt in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-27-2006, 06:45 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