select specific pair number

i have an list of numbers but need to pick an specific
for example

need show all numbers with 09 and show and new sheet same position
98765.xlsx
ADRIANA PACCOUNTING ASSISTANTAsked:
Who is Participating?
 
aikimarkConnect With a Mentor Commented:
Please test this:
Sub Q_29075122()
    Dim oRE As Object
    Dim wks As Worksheet
    Dim rng As Range
    Dim rngCell As Range
    
    Set wks = ActiveSheet
    
    Set oRE = CreateObject("vbscript.regexp")
    oRE.Global = False
    oRE.Pattern = "0.*9|9.*0"
    
    Set rng = wks.Range(Range("D5"), wks.UsedRange.SpecialCells(xlCellTypeLastCell))
    Application.ScreenUpdating = False
    For Each rngCell In rng
        If oRE.test(rngCell.Value) Then
        Else
            rngCell.Clear
        End If
    Next
    Application.ScreenUpdating = True
End Sub

Open in new window

0
 
aikimarkCommented:
need show all numbers with 09 and show and new sheet same position
I could use a little more detail or a workbook example with your sample data.  Finding/filtering values is common.  I don't understand your output/result requirement.
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
aikimark  thanks for the fas response

Sheet data  have the list
like this
12.PNG
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
after i look for 09

it just keep on the numbers with 09  and that what i need

234.PNG
0
 
aikimarkCommented:
So, you want to clear the contents of any cell that does not contain "09"?
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
aikimark  Yes !
0
 
aikimarkCommented:
In your example, there are non-empty cells that do not contain "09", such as 079, 019, and 039
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
aikimark

1- i have an list of numbers
2- then i need pick up just the number ( in this sample 09)
3- 09 can be any position of the number like ( 0x9, 09x, x09, 90x, 9x0, x90)

i need be keep in the same positon of the original data in
0
 
aikimarkCommented:
Are you always going to select two digits?  If not, how much variance?
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
aikimark
 in this situation  i always look for 2 digit
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
aikimark  thanks

can you provide an sample  

im not an computer literacy

i  mean i don't know how use the code
0
 
aikimarkCommented:
1. Open the VBProject window (Alt+F11)
2. Insert a module in your workbook.
3. Copy/paste the code into the module
4. In the Developer ribbon, Run Macro
5. Select the name of the routine.
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
aikimark thanks

but

is not working
0
 
aikimarkCommented:
upload the workbook
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Here is !
98765_A.xlsm
0
 
aikimarkCommented:
The routine was missing an End Sub statement.
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
ok but

Im  looking for an more complete solution
like for example

i need a input to enter the data i need look for
then an button to make the look for
0
 
ADRIANA PACCOUNTING ASSISTANTAuthor Commented:
Thanks ! Expert
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.