PDA

View Full Version : Extract record based on company



ashmita
09-07-2021, 11:40 PM
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

arnelgp
09-08-2021, 01:34 AM
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/8czawhs0j6u80ytmkkkii/Search.xlsm?dl=0&rlkey=sv1xhr8yo0ca11chnfkatc8mk

ashmita
09-08-2021, 03:53 AM
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

ashmita
09-09-2021, 11:20 PM
Can anyone please help me how to proceed.

arnelgp
09-10-2021, 02:09 AM
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/pdhzoi0mw54opafrrz9al/Search.xlsm?dl=0&rlkey=1hd77ldpk7eworo2gipvllpc9

Aussiebear
09-10-2021, 02:20 AM
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

arnelgp
09-10-2021, 03:07 AM
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:"?

Aussiebear
09-10-2021, 06:37 AM
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.

ashmita
09-12-2021, 08:31 PM
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.

28956
28957

ashmita
09-13-2021, 11:04 PM
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