014. Excel VBA FIND function Example (Not found, 1 match and multiple matches)

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 พ.ย. 2024

ความคิดเห็น • 19

  • @andybamby
    @andybamby ปีที่แล้ว +2

    Excellent, good explanation, point by point...

  • @stevereed5776
    @stevereed5776 9 หลายเดือนก่อน +1

    Great explanation, thank you very much, helps me out a lot

  • @alanrobbo6980
    @alanrobbo6980 หลายเดือนก่อน

    Fantastic, Thank You.

  • @rewatiraman2956
    @rewatiraman2956 ปีที่แล้ว +1

    sir you are genious

  • @georgemathew860
    @georgemathew860 25 วันที่ผ่านมา

    How this can be done using vba array as well as tables listobject thank you 🙏

    • @EXCELWIZARDINMINUTES
      @EXCELWIZARDINMINUTES  25 วันที่ผ่านมา

      @georgemathew860 if u r interested in vba, i have a course that explains arrays and all the concepts needed to code: www.udemy.com/course/vba-course-excel/?referralCode=D136051609B9FE0FD4E5

    • @EXCELWIZARDINMINUTES
      @EXCELWIZARDINMINUTES  25 วันที่ผ่านมา

      @georgemathew860 this is an example of a code:
      Sub FindInArrayAndListObject()
      Dim ws As Worksheet
      Dim tbl As ListObject
      Dim dataArray As Variant
      Dim i As Long
      Dim searchValue As String
      Dim found As Boolean
      ' Set the worksheet and ListObject
      Set ws = ThisWorkbook.Sheets("Sheet1")
      Set tbl = ws.ListObjects("Table1")
      ' Define the value you are looking for
      searchValue = "SearchValue" ' Replace this with the value you want to find
      ' Load the ListObject's data into an array
      dataArray = tbl.DataBodyRange.Value
      ' Loop through the array to find the value in the first column
      found = False
      For i = LBound(dataArray, 1) To UBound(dataArray, 1)
      If dataArray(i, 1) = searchValue Then
      MsgBox "Value found in row " & i
      found = True
      Exit For
      End If
      Next i
      If Not found Then
      MsgBox "Value not found"
      End If
      End Sub

  • @Nits_nandy
    @Nits_nandy 2 ปีที่แล้ว +2

    Hello sir, can I get the basic VBA links if u have posted ? I am very new to vba

    • @EXCELWIZARDINMINUTES
      @EXCELWIZARDINMINUTES  2 ปีที่แล้ว +1

      Sure. The link to the workbook is in the video description. If you r new, i suggest you start with the first vba lesson and advance 1 by 1. New videos are going to come every day on the topic.

    • @EXCELWIZARDINMINUTES
      @EXCELWIZARDINMINUTES  2 ปีที่แล้ว

      Hello, yes in many of the videos about VBA (check the VBA playlist), u can go to the descriptions and u will find a link to download the workbook. If u need more of them (ie the workbook is not available to download), just leave a comment and i will respond with the link. :) also let me know if u r improving in VBA after completing those basic lessons

  • @jeromeayson631
    @jeromeayson631 2 ปีที่แล้ว +1

    Hi sir can I have your email
    So that I send a clearl explaination what I trying to do with my large excel files, extracting and copy a data. Thank you

    • @EXCELWIZARDINMINUTES
      @EXCELWIZARDINMINUTES  2 ปีที่แล้ว +1

      Hello Jerome, unfortunately, I dont troubleshoot each issue. However, I suggest you try to explain ur problem here and maybe post some pics about ur issue. U might also want to record it on video and post the link here.
      Based on this, I will try to guide you on how to solve it.

    • @jeromeayson631
      @jeromeayson631 2 ปีที่แล้ว

      @@EXCELWIZARDINMINUTES
      Hello sir
      I was trying to copy a group of lines or cells/table in column A only. Because thrs hundred of groups in my single file, every cells contains wordS , Every groups has different number of cells may be 8 or 10 or 20.
      My task is to copy a groups that stars with the cell/words ( for example ) ' TODAYS ACTIVITY' and end with the cell/words 'GOODBYE FOR NOW' but with in that group ther must be a words 'GREAT JOB'. I hope thrs a code for this. to lessen in doing controlF highlight and copy then paste again and again. Thank you in advance sir.

    • @EXCELWIZARDINMINUTES
      @EXCELWIZARDINMINUTES  2 ปีที่แล้ว +1

      Hello Jerome, yes there is a way you can do this with VBA. U need to have a good understanding in VBA to be able to achieve the task. Here are the steps:
      1) create a sub
      2) use a loop to go through ur data. Every time the index has to increase by 1
      3) create 3 variables as integer. V1, V2,V3. Each of the those variable will be used to identify if u get the great job, the today activity and goodbye
      4) create a rowstart variable as long. This is to store ur start row for copyinf
      5) with if statements, u have to populate ur variables. In case there is a match, u put 1 in the variable.
      Also u need to store the start row when u find today s activity in rowstart
      6) Then with another if u check if all the variables are 1, then u need to copy paste the data (u start from rowstart till current row)
      If u dont have solid fundations in vba, have a look at the vba playlist. Study the if statement, the variable, the copy paste and the loops at least . Have a go and paste ur code here. I will be able to tell u if u are going in the right direction

    • @jeromeayson631
      @jeromeayson631 2 ปีที่แล้ว +1

      @@EXCELWIZARDINMINUTES thank you so much sir. Thank you