+ Reply to Thread
Results 1 to 7 of 7

Using LookAt:=xlWhole constant with Find-Not working

  1. #1
    Registered User
    Join Date
    02-07-2019
    Location
    New Delhi
    MS-Off Ver
    2010
    Posts
    80

    Using LookAt:=xlWhole constant with Find-Not working

    Hello Team,

    I'm quite new to VBA and need your help!!

    I have a range B2:B7 wherein two names are available Rahulkhera singh and Rahul Kumar, I need to find out separately each name. I'm able to find out Rahulkhera with the help of xlPart one of the parameter of Find. But it is not working with LookAt:=xlWhole, getting error - Object variable not set (Error 91)

    I'm attaching a file for your reference. Please do the needful.

    Thank you.

    Regards,
    Manish
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,210

    Re: Using LookAt:=xlWhole constant with Find-Not working

    It is not clear what you want to do from you example


    To match the whole, the whole cell has to match your text your are searching for, nothing in the cells is just Rahul so it will find nothing

    To match part Rahul would match in both names as they both contain Rahul

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,210

    Re: Using LookAt:=xlWhole constant with Find-Not working

    Depends what you want to do you want to do with these names once found...
    One option...
    Please Login or Register  to view this content.
    are other options aswell...Loop, Array, formula etc etc
    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!!!

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,481

    Re: Using LookAt:=xlWhole constant with Find-Not working

    You can't look at xlwhole unless you use wildcards.

    Here is a find loop

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    02-07-2019
    Location
    New Delhi
    MS-Off Ver
    2010
    Posts
    80

    Re: Using LookAt:=xlWhole constant with Find-Not working

    I'm sorry for the confusion here!!

    I was just able to solve the problem. Your explanation does match with my result.

    In order to match whole, I should have used the whole word that contain in cell for find parameters.

    Thank you for your support.

    Regards,
    Manish

  6. #6
    Registered User
    Join Date
    02-07-2019
    Location
    New Delhi
    MS-Off Ver
    2010
    Posts
    80

    Re: Using LookAt:=xlWhole constant with Find-Not working

    Thanks a lot!!

    Warm Regards,
    Manish

  7. #7
    Registered User
    Join Date
    02-07-2019
    Location
    New Delhi
    MS-Off Ver
    2010
    Posts
    80

    Re: Using LookAt:=xlWhole constant with Find-Not working

    Thanks a million.

    Warm Regards,
    Manish

+ 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] vba excel - Find LookAt not matching the inputted value
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2018, 01:27 PM
  2. Replies: 10
    Last Post: 02-03-2017, 01:29 AM
  3. [SOLVED] Find Command: xlWhole vs. XLPart
    By dflak in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-25-2016, 05:11 PM
  4. [SOLVED] Find Method - can't get LookAt:=xlWhole to work
    By mo4391 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-08-2016, 09:04 AM
  5. Macro - Find and Replace - LookAt Issues
    By drewmey in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 10-07-2014, 04:42 AM
  6. [SOLVED] lookat whole
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2012, 06:10 AM
  7. Replies: 4
    Last Post: 11-10-2005, 07:41 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