+ Reply to Thread
Results 1 to 11 of 11

How to delete cells with decimal numbers?

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    brazil
    MS-Off Ver
    Excel 2007
    Posts
    64

    How to delete cells with decimal numbers?

    Please, I did a search:
    http://www.excelforum.com/excel-prog...-integers.html

    and found this code from JBeaucaire:

    Please Login or Register  to view this content.
    The forum rules say I must start a new thread.

    I've tried and that code works.

    But I have a simple question:
    making a small change in this code, how to delete just the cells with decimal values, not the entire row?

    My very humble experience with VBA isn't enough to adjust this.
    Last edited by dualaudio454252; 01-10-2014 at 04:43 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: How to delete cells with decimal numbers?

    Hi,

    Try:
    Please Login or Register  to view this content.
    Just remove the "EntireRow" from the code.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    brazil
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: How to delete cells with decimal numbers?

    MarvinP, I've tried this change, but still doesn't work.

    Here's the sheet I"m working on:
    VBA TO DELETE DECIMALS.xls

    I've tried to use ActiveCell, ActiveCells, Cell, etc ?!?! but...

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to delete cells with decimal numbers?

    Maybe:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-19-2013
    Location
    brazil
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: How to delete cells with decimal numbers?

    Thank you, JOHN H. DAVIS, but didn't work too.The numbers don't move!

    Very elegant code!

  6. #6
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: How to delete cells with decimal numbers?

    You could try something like this, but you will have to decide what level of sensitivity you are willing to accept.
    Please Login or Register  to view this content.
    Greg
    Just a guy trying to make work stuff easier.

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: How to delete cells with decimal numbers?

    Quote Originally Posted by dualaudio454252 View Post
    Thank you, JOHN H. DAVIS, but didn't work too.The numbers don't move!

    Very elegant code!
    Which way do you want them to move? Left or up?

  8. #8
    Registered User
    Join Date
    06-19-2013
    Location
    brazil
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: How to delete cells with decimal numbers?

    Fantastic, gsnidow! That's it!

    Thank you so much to you all!!!!!!

  9. #9
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: How to delete cells with decimal numbers?

    Quote Originally Posted by dualaudio454252 View Post
    how to delete just the cells with decimal values, not the entire row?
    Perhaps some clarification is needed on this point. When you say "delete", do you mean delete as in you will have to either shift everything up or right or left (probably not what you want). Or, do you mean to just set the cell's value to null (or blank)?

  10. #10
    Forum Contributor gsnidow's Avatar
    Join Date
    07-22-2010
    Location
    Richmond, VA
    MS-Off Ver
    Excel 2007
    Posts
    150

    Re: How to delete cells with decimal numbers?

    Quote Originally Posted by dualaudio454252 View Post
    Fantastic, gsnidow! That's it!

    Thank you so much to you all!!!!!!
    Now you need to be carefull with that. Eventhough you might see, say, 12, in any given cell, the value that Excel is storing might be 12.000001, or something else like that. If you play around with it by increasing the number of decimal places you are willing to accept, you will see what I mean. Good luck.

  11. #11
    Registered User
    Join Date
    06-19-2013
    Location
    brazil
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: How to delete cells with decimal numbers?

    JOHN H. DAVIS, when I replied to gsnidow your message appeared.

    Well, I just want that the numbers disappear or shift up.

    But the way gsnidow solved this is enough to me!

+ 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. How do I delete multiple cells with decimal, not whole, numbers?
    By Implicity in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-10-2005, 07:05 PM

Tags for this Thread

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