Consulting

Results 1 to 10 of 10

Thread: Extract record based on company

  1. #1
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location

    Extract record based on company

    Hello Everyone,
    The below script has been developed to search any keyword in the excel workbook and retrieve the result.
    My requirement is to add a check point to retrieve data based on particular company.
    Therefore I have created 4 button for each company within the sheet and would require only those data based on selecting that company.
    Can anyone please help me.
    Sub Worksheet_Change(ByVal Target As Range)
        Dim Fnd As Range, Crit As String
        If Not Intersect(Target, Range("H11")) Is Nothing Then
            Rows(14 & ":" & Rows.Count).Delete
            If Target = "" Then Exit Sub
            Crit = IIf(IsNumeric(Target), Target, "*" & Target & "*")
            With Sheets("Data").Cells(1).CurrentRegion
                Set Fnd = .Cells.Find(Crit, , xlValues, xlPart)
                If Not Fnd Is Nothing Then
                    .AutoFilter Fnd.Column, Fnd
                    Union(.Columns("A:B"), .Columns("H:I"), .Columns("N")).Offset(1).Copy Range("G14")
                    Range("G14").CurrentRegion.Borders.Weight = 2
                Else
                    MsgBox "NOT FOUND", vbInformation, ""
                End If
                .AutoFilter
            End With
        End If
    End Sub
    Attached Files Attached Files

  2. #2
    you create a Macro that will filter the range.
    then you modify the macro.
    you then assing macro to each shapes.

    sorry, i cannot attached it here.
    https://www.dropbox.com/scl/fi/8czaw...a11chnfkatc8mk

  3. #3
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location
    Thank you so much sir. It is working only "Version" column but when I enter the keyword from other column (Say country name as 'usa' or 'japan'), it is not filtering those records. can you please check once

  4. #4
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location
    Can anyone please help me how to proceed.

  5. #5
    here try this again
    if you need to add another "shape", right click on the
    new shape then you Assign Macro (select ShapeAction macro).
    https://www.dropbox.com/scl/fi/pdhzo...woro2gipvllpc9

  6. #6
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,053
    Location
    If you wish to attach a file to your post, look down to the bottom of your post and you will see "Manage Attachments", click on this and from there you will be able to select your file to attach, and follow the prompts. There is a size limit so keep that in mind
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  7. #7
    Quote Originally Posted by Aussiebear View Post
    If you wish to attach a file to your post, look down to the bottom of your post and you will see "Manage Attachments", click on this and from there you will be able to select your file to attach, and follow the prompts. There is a size limit so keep that in mind
    I know, but my browser would not let me Attach anything to this forum.
    it is Tagging it as "Not Secure". the site has no "https:"?

  8. #8
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,053
    Location
    This is a matter for the Site Admin/Owners. I also note that my system notifies me that the site is "unsecure", but I dont have the concerns your system seems to have.
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  9. #9
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location
    It is still not working. I think you have not understood my criteria .
    My aim is to filter records based on company (ABC, BCD, CDE and ALL) only.
    Whatever the keyword I will search, the final output should filter based on the above three company.
    In below example, I want to pull all data by searching the keyword 'usa'. Once all data retrieved, now I want to filter it based on above company which is not working.

    1.jpg
    2.jpg

  10. #10
    VBAX Regular
    Joined
    Aug 2021
    Posts
    8
    Location
    Can anyone help me please to resolve my query.
    My requirement is based on two criteria.
    1) A VBA has been developed that will search any keyword and pull all the results.----this is done
    2)Once the output is retrieved, I need to filter the retrieved result (extracted by first criteria with above macro) based on four box (ABC, BCD, CDE and ALL) indicating companywise only.

    Hope I will get the solution soon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •