Excel VBA FIND Function (& how to handle if value NOT found)

23
18



Quickly learn how to use the VBA FIND Function. What parameters are required. How to look for partial matches or for complete matches (whole word). Also if VBA should search in the cells, formulas or comments. I also show you how to handle cases if VBA FIND doesn’t find a value. So in cases where your text or value is not found.

You’ll want to account for this, because in case your text or value is not found, you’ll get a VBA error. In order to avoid the error, you can use the VBA IF statement. This ensures that if a value is not found, you will not end up with an error, instead you can decide what you’d like to do (in the video I’ll show you how to create a custom message box, informing the user that the value was not found).

★ Links to related videos: ★
Check out the full playlist:

★ My Online Excel Courses ★

Courses ►

✉ Subscribe & get my TOP 10 Excel formulas e-book for free

EXCEL RESOURCES I Recommend:

Get Office 365:
Microsoft Surface:

GEAR
Camera:
Screen recorder:
Microphone:
Lights:

Note: This description contains affiliate links, which means at no additional cost to you, we will receive a small commission if you make a purchase using the links. This helps support the channel and allows us to continue to make videos like this. Thank you for your support!

#ExcelVBA

Nguồn:https://dantrionline.com.vn/


https://danhnhan.vn/lam-dep

23 COMMENTS

  1. Very good Leila, but it seems not to work when you are looking for a date, column C, in your example. I guess is a problem of conversion (strings??), can you clarify that?

  2. hi, I love all your excel vba's, may I ask something? Q: how to AUTO pop-up the find application (the one appears when we do CTRL+F) when I activate Sheet1? I mean, if I clicked "Sheet1" there is already a ("Ctrl+F") find app ready to input a certain values or text on it. (This is my situation, I have different similar data that I want to find everytime I clicked a certain sheet on column A or the very first column. so i want to save like few seconds on everytime I look a data on it.) I find it more convenient to me to use the excel CTRL+F app. Thank you more power!

  3. Mam I have a problems ,
    I have data like
    " 23a 50c 12k " in a one cell,
    When I search 50c, the cells 50c should be bold and italic .
    Please help me .

  4. "If Not CompId Is Nothing Then" — this is the content I came for. Couldn't find it anywhere else! Thank you! This is the second time I've found explanations here and nowhere else. Your presentations are very clear for newbies like myself.

  5. How can I use cell reference as the Find value to another sheet so if the cell reference changes, it will find another cell based on that cell reference value. Thanks.

  6. how can i search for a value in sheet 2 from a value i enter on sheet1, and then update the cells of that row with new information from sheet 1. Sheet 1 is a user form i created with vba that inputs new information one row at a time… but I cant' get sheet 1 to not put a duplicate, and instead update information of the value already there.

  7. can anyone tell me how to do a vba find that will select each highlighted cell (cell has no values), and will allow me to loop through all of them.

  8. Dear Madam I need excel text function by VBA code

    I mean WorksheetFunction.text(12,"00000")
    Desire result =00012

    How it possible by VBA

  9. Hello Leila, Kudos to you and your knowledge about excel. The way you have explained this video is what I was looking for. Was expecting something from MS to do 🙂
    I was also wondering, if you can share the link on how you calculated many matches in this example ? Thanks in advance!

  10. please how can i find the properties for a button in excel 2016 as in the one similar to the properties in the developer tab but this time referring to a button instead

  11. How to handle the find error without defining the object. Can we do it with if function.

    E.g I have two workbooks one has 5 column while other has 4 columns… So if I am finding the column header of ist workbook and I want to keep that as a general statement; however my 2nd workbook doesn't contain that column header; how should I avoid that situation/error .And how to skip further steps that follow in line with the find code.. If I am using find function for locating the column heads..

    Here is the code that needs to be corrected

    If cells.find(what:="Name", after:= active cell).activate
    Selection.clearcontents
    Active cell.value = "New name)
    End if

LEAVE A REPLY

Please enter your comment!
Please enter your name here