+ Reply to Thread
Results 1 to 5 of 5

How to remove only cells with numeric values from range

  1. #1
    Registered User
    Join Date
    09-07-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010 Mac
    Posts
    29

    How to remove only cells with numeric values from range

    puzzled on this.......

    I have three columns with data. Some cells are just words, some are words with a number ("4 lights"), and others are just prices ("$20.00"). How can I clear ONLY the cells that have prices? I tried a few scripts and a PUPMac delete all numeric, but they remove the numbers from cells with alphanumeric data.

    suggestion?

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to remove only cells with numeric values from range

    Try highlighting all 3 columns
    Press CTRL + G
    Click Special
    Select Constans - Numbers
    OK
    Right click a highlighted cell, Clear contents.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: How to remove only cells with numeric values from range

    Assuming you have data in col. A, col. B and col. C, then you can try following code to clear cells which have currencies.
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Registered User
    Join Date
    09-07-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010 Mac
    Posts
    29

    Re: How to remove only cells with numeric values from range

    That was it Jonmo......Thanks!

    also figured this out in VBA:

    Sub clear()

    For Each Cell In Selection
    If IsNumeric(Cell) Then
    Cell.Value = ""
    End If
    Next
    End Sub

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: How to remove only cells with numeric values from range

    You're welcome..

    If it must be VBA, try using the macro recorder while doing the steps I described.

    That would give you some code that does the task without having to loop through all the cells.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] vba macros to force user to input numeric values for numeric values with hyphen
    By Abdur_rahman in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-28-2013, 01:05 PM
  2. [SOLVED] Sum of numeric values within cells also containing non-numeric characters
    By Mike Brewer in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 04-24-2013, 09:16 AM
  3. Replies: 1
    Last Post: 11-03-2011, 11:43 AM
  4. Check for numeric values in a range
    By KDN in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-16-2010, 05:43 PM
  5. Trying to add numeric values in range
    By windme in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-29-2006, 10:07 PM

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