+ Reply to Thread
Results 1 to 6 of 6

Macro to delete alpha and alpha numeric values

  1. #1
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Macro to delete alpha and alpha numeric values

    I am looking for a macro to delete any Alpha and Alpha Numeric cell values in a column.
    Below is the sample data and desired result I am looking for. Please help

    Column A Desired Result
    9 9
    22 22
    24 24
    31 31
    1212USA20103
    USA2865
    USA
    USA5494
    ABCD
    USA7505
    Last edited by vijanand1279; 01-20-2011 at 12:02 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to delete alpha and alpha numeric values

    Assuming the numbers are indeed stored as numbers (and not numbers stored as text)

    Please Login or Register  to view this content.
    the same could be achieved using F5 natively.

    (we assume above values are constants and not result of formulae - adapt as nec.)

  3. #3
    Forum Contributor
    Join Date
    08-02-2007
    Location
    Panama & Austria
    MS-Off Ver
    2003 & 2010
    Posts
    186

    Re: Macro to delete alpha and alpha numeric values

    Hi,
    Try:
    Please Login or Register  to view this content.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to delete alpha and alpha numeric values

    @Wizz, FWIW, when using SpecialCells it's always worth adding a handler.
    For ex. were you to run your routine and then re-run immediately you would generate a Debug as no cells would be found (they were cleared first time around).

  5. #5
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Macro to delete alpha and alpha numeric values

    Quote Originally Posted by Wizz View Post
    Hi,
    Try:
    Please Login or Register  to view this content.
    When I run the macro above in the attached file it clears all the values because the Format of column is in text. Even If I change the format to number Zero decimals it is not working. Please help See attached....
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to delete alpha and alpha numeric values

    You must coerce beforehand:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1