Filtering by items that begin with a number

pbgexcel

New Member
Joined
Jan 2, 2018
Messages
26
Good afternoon all,

I'm look to automate the filtering of a large Excel database. I want to include in my code a bit that will be able to filter a particular column so that only the items that begin with a number (0-9) in that column are visible. I'm very comfortable with VBA and have been trying to record a macro doing this to have some code to get started with, but found that I'm not sure how to even do so manually. Any ideas how I can filter a column only on those items that begin with a number?

Thanks so much for all your help!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Code:
Sub Hide_Columns()
    Dim rg As Range
    
    Set rg = Selection
    Application.ScreenUpdating = False
    For Each cell In rg
        cell.EntireRow.Hidden = IsNumeric(Left(cell, 1))
    Next cell
    Application.ScreenUpdating = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,632
Latest member
jladair

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