Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8033623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T01:45:12+00:00 2026-06-05T01:45:12+00:00

I have a 1500 row excel file. In the first column I have characters

  • 0
  1. I have a 1500 row excel file.
  2. In the first column I have characters mixed up with numbers (every row is different).
  3. I would like to leave only the numbers and delete the alpha characters.

For example in A1 I have

f90f5j49,35.48

and after I delete the alpha characters it should be

905493548

What is the best way to do this?

I did find this youtube solution

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T01:45:13+00:00Added an answer on June 5, 2026 at 1:45 am

    Your method is the right approach.

    The quickest way to implement this is to use

    • a regexp
    • and a variant array in VBA.

    Using code based on my Article Using Variant Arrays in Excel VBA for Large Scale Data Manipulation

    Sub KillNonNumbers()
        Dim rng1 As Range
        Dim rngArea As Range
        Dim lngRow As Long
        Dim lngCol As Long
        Dim lngCalc As Long
        Dim objReg As Object
        Dim X()
    
    
        On Error Resume Next
        Set rng1 = Application.InputBox("Select range for the replacement of non-number", "User select", Selection.Address, , , , , 8)
        If rng1 Is Nothing Then Exit Sub
        On Error GoTo 0
    
        'See Patrick Matthews excellent article on using Regular Expressions with VBA
        Set objReg = CreateObject("vbscript.regexp")
        objReg.Pattern = "[^\d]+"
        objReg.Global = True
    
       'Speed up the code by turning off screenupdating and setting calculation to manual
       'Disable any code events that may occur when writing to cells
        With Application
            lngCalc = .Calculation
            .ScreenUpdating = False
            .Calculation = xlCalculationManual
            .EnableEvents = False
        End With
    
        'Test each area in the user selected range
    
        'Non contiguous range areas are common when using SpecialCells to define specific cell types to work on
        For Each rngArea In rng1.Areas
            'The most common outcome is used for the True outcome to optimise code speed
            If rngArea.Cells.Count > 1 Then
               'If there is more than once cell then set the variant array to the dimensions of the range area
               'Using Value2 provides a useful speed improvement over Value. On my testing it was 2% on blank cells, up to 10% on non-blanks
                X = rngArea.Value2
                For lngRow = 1 To rngArea.Rows.Count
                    For lngCol = 1 To rngArea.Columns.Count
                        'replace the leading zeroes
                        X(lngRow, lngCol) = objReg.Replace(X(lngRow, lngCol), vbNullString)
                    Next lngCol
                Next lngRow
                'Dump the updated array sans leading zeroes back over the initial range
                rngArea.Value2 = X
            Else
                'caters for a single cell range area. No variant array required
                rngArea.Value = objReg.Replace(rngArea.Value, vbNullString)
            End If
        Next rngArea
    
        'cleanup the Application settings
        With Application
            .ScreenUpdating = True
            .Calculation = lngCalc
            .EnableEvents = True
        End With
    
        Set objReg = Nothing
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a table like this: ID oamount '1' '1500' '2' '2000' '3' '2000'
I have a scenario with code like the following: extracted_data = data.map{|row| ((row.some_long_number.to_f) if
I am stuck here. I have row in Postgres like this: id amount a
I have a table1 like this: Date Reading Cost 2009-01-01 5.00 1500.00 2009-01-02 10.00
Currently I have following XML: <Rowsets> <Rowset> <Row> <DrilldownDepth>0</DrilldownDepth> <ScheduleWeek>---</ScheduleWeek> <ABC>---</ABC> <PQR>1500</PQR> <XYZ>15000</XYZ> <Quant>285</Quant>
I have a CSV with the first row containing the field names. Example data
I have a loop that runs for approx. 25 minutes i.e 1500 seconds. [100
I have 3 tables: addresses id, address, city, zipcode persons (1500 records) id, address_id,
I have this data: 1, 0., 0., 1500. . . 21, 0., 2000., 1500.
Suppose I have this XML as a string: <calles> <calle> <nombre>CALLAO AV.</nombre> <altura>1500</altura> <longitud>-58.3918617027</longitud>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.