VBA macro Text Filters -> Contains

K0st4din

Well-known Member
Joined
Feb 8, 2012
Messages
501
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Platform
  1. Windows
Hello, everyone,
please for your assistance.
I have made a VBA form in which there is TextBox1.
I want to write something to find it in the selected worksheet named "Base" and column "P". (this part is most difficult for me to do).
I mean - Text Filters -> Contains
I would be very grateful if you could help me.
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Let's Start here...

Paste the below code in the code window of your BASE worksheet.

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$P$4" Then
Target.Value = TextBox1.Value
End If
End Sub

Then Click on Cell P4 of your Worksheet "Base".
 
Upvote 0
Maybe something like
Code:
   Sheets("Base").Range("A1:P1").AutoFilter 16, "*" & TextBox1.Value & "*"
 
Upvote 0
Maybe something like
Code:
   Sheets("Base").Range("A1:P1").AutoFilter 16, "*" & TextBox1.Value & "*"
Thank you so much.
It has done a very good job, the macro.
Be alive and healthy.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,900
Messages
6,175,276
Members
452,629
Latest member
SahilPolekar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top