+ Reply to Thread
Results 1 to 23 of 23

Remove all numbers >=3 but leave T and L .

  1. #1
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    446

    Remove all numbers >=3 but leave T and L .

    Hello all ,

    I am needing a fast working macro that can remove in col G all numbers >=3 and leave cells blank , but leave behind all T and L .

    Thanks .
    Attached Files Attached Files
    I am grateful for all answers to my questions .
    Also i give a reputation even if not answered .

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Remove all numbers >=3 but leave T and L .

    Can you have numbers < 3 that need to be kept?

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Remove all numbers >=3 but leave T and L .

    Try
    Please Login or Register  to view this content.
    Last edited by PCI; 11-10-2019 at 04:50 PM.
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Remove all numbers >=3 but leave T and L .

    Judging by a previous post all your numbers will be >=3, in which case you can use
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    446

    Re: Remove all numbers >=3 but leave T and L .

    Thanks for reply , there will not be any numbers <=2 .
    Other words there are no 1,s or 2,s there at all , these are referred to as T and L which are to be left only .

    Thanks .

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Remove all numbers >=3 but leave T and L .

    there are no 1,s or 2,s

    So here a remake
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    446

    Re: Remove all numbers >=3 but leave T and L .

    Fluff13 , yours deletes everything in col G .

    PCI your first one went error yellow on line
    Range(Cells(1, "G"), Cells(Rows.Count, "G").End(3)).SpecialCells(xlCellTypeVisible).ClearContents

    And your 2nd one did nothing except remove all my headings

    Also im testing on a 490,000 row sheet .

    Thanks .

  8. #8
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Remove all numbers >=3 but leave T and L .

    A remake with no test with so many rows ...!
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    446

    Re: Remove all numbers >=3 but leave T and L .

    That one just took the filter off the headings . Thanks .

  10. #10
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Remove all numbers >=3 but leave T and L .

    Can you just do a firsttest with the file you attached.
    BTW your file did not have any 1's and 2's ...!

  11. #11
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Remove all numbers >=3 but leave T and L .

    Quote Originally Posted by Fluff13 View Post
    Judging by a previous post all your numbers will be >=3, in which case you can use
    Please Login or Register  to view this content.
    Quote Originally Posted by PCI View Post
    Please Login or Register  to view this content.
    You cannot use SpecialCells on the OP's data... he has 490,000 rows of data and is using XL2007 (8000+ limit for SpecialCells if I remember correctly).

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,077

    Re: Remove all numbers >=3 but leave T and L .

    Quote Originally Posted by Rick Rothstein View Post
    You cannot use SpecialCells on the OP's data... he has 490,000 rows of data and is using XL2007 (8000+ limit for SpecialCells if I remember correctly).
    Thanks for that Rick.
    Wasn't aware of the limits & works quite happily in O365

  13. #13
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Remove all numbers >=3 but leave T and L .

    Quote Originally Posted by Fluff13 View Post
    Thanks for that Rick.
    Wasn't aware of the limits & works quite happily in O365
    Microsoft raised the limit (not sure what it is now, but I don't think it is reachable any more) in XL2010.

  14. #14
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Remove all numbers >=3 but leave T and L .

    Same player shot again
    Another one perhaps it takes time ...!


    Please Login or Register  to view this content.

  15. #15
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,410

    Re: Remove all numbers >=3 but leave T and L .

    Quote Originally Posted by Rick Rothstein View Post
    You cannot use SpecialCells on the OP's data... he has 490,000 rows of data and is using XL2007 (8000+ limit for SpecialCells if I remember correctly).
    *** CORRECTION ***

    It has been too many years since I had to deal with this and I had remembered incorrectly... the limit for Excel prior to 2010 is not 8000+ cells, it is 8000+ (actually, 8192) non-contiguous ranges (Areas) no matter how many cells are in each Area. So I am guessing the OP has blank rows (lots of them) within his 490,000 rows of data. Here is a mini-blog article I wrote about this (with a method to get around the limit) several years ago...

    http://www.excelfox.com/forum/showth...Cells-Function
    Last edited by Rick Rothstein; 11-10-2019 at 06:29 PM.

  16. #16
    Valued Forum Contributor
    Join Date
    02-02-2016
    Location
    Indonesia
    MS-Off Ver
    Office 365
    Posts
    1,004

    Re: Remove all numbers >=3 but leave T and L .

    Try this:
    I assumed the values of column G are only numbers or "T" or "L".
    The code will sort the data by col G in descending order then remove all rows below the last "L".

    Please Login or Register  to view this content.
    Edit:
    If you only want to clear the content of col G, use this one:


    Please Login or Register  to view this content.
    Last edited by Akuini; 11-10-2019 at 07:11 PM.

  17. #17
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Remove all numbers >=3 but leave T and L .

    Hi,

    Like Rick yet wrote, I confirm for SpecialCells, maybe the most vicious VBA method as not only 'cause of its results limit
    but as it no raises any error if there are more results than its limit, can be messy ! …

  18. #18
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,522

    Re: Remove all numbers >=3 but leave T and L .

    Quote Originally Posted by I need excel help View Post
    im testing on a 490,000 row sheet .
    See if this works faster...
    Please Login or Register  to view this content.
    Last edited by jindon; 11-11-2019 at 02:09 AM.

  19. #19
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Remove all numbers >=3 but leave T and L .

    ... and ... : ) ... :
    Please Login or Register  to view this content.

  20. #20
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,585

    Re: Remove all numbers >=3 but leave T and L .

    Try this code.It is fastest.
    Please Login or Register  to view this content.
    Last edited by kvsrinivasamurthy; 11-11-2019 at 02:25 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  21. #21
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Remove all numbers >=3 but leave T and L .

    Thx again Rick:
    for the information and to take care until the last detail

  22. #22
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Remove all numbers >=3 but leave T and L .

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  23. #23
    Forum Contributor
    Join Date
    12-12-2017
    Location
    New Zealand
    MS-Off Ver
    Ms Office 2016
    Posts
    446

    Re: Remove all numbers >=3 but leave T and L .

    thanks to all

+ 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] Remove letters and leave numbers only
    By douglascaixeta in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-15-2018, 05:12 PM
  2. [SOLVED] Remove sheet shapes, leave pictures?
    By B.W.B. in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-07-2017, 02:23 PM
  3. [SOLVED] Remove duplicates but leave the lowest value
    By WT2008 in forum Excel General
    Replies: 7
    Last Post: 03-21-2015, 02:33 PM
  4. Remove numbers, leave letters in a string
    By roxdrob in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 03-31-2014, 09:13 PM
  5. [SOLVED] Remove formula and leave original value
    By DeanP in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2013, 08:47 AM
  6. How can I remove the #NUM from a cell and leave it blank?
    By Sharonits in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-09-2013, 04:16 PM
  7. Remove a cell's text & leave a number in it.
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-26-2008, 11:45 AM

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