+ Reply to Thread
Results 1 to 7 of 7

Can I remove blanks from a range without using sort?

  1. #1
    Hugh Murfitt
    Guest

    Can I remove blanks from a range without using sort?

    I have a range of cells A1:a10, say, which obtain data from another source.
    Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
    How do I reorder this range such that the cells containing information are
    listed together, removing the blanks? I want to do this using a formula,
    rather than filter or sort, as the data, and hence the blank cells, will
    change, and I want to perform analysis on the cells containing data.

  2. #2
    R.VENKATARAMAN
    Guest

    Re: Can I remove blanks from a range without using sort?

    this is

    from one of the newsgroup correspondents

    use this code statement

    Range("a1:a10").SpecialCells(xlCellTypeBlanks).EntireRow.Delete



    =================================

    Hugh Murfitt <[email protected]> wrote in message
    news:[email protected]...
    > I have a range of cells A1:a10, say, which obtain data from another

    source.
    > Some of those cells a3, a6:a8, say, under certain conditions, will be

    blank.
    > How do I reorder this range such that the cells containing information

    are
    > listed together, removing the blanks? I want to do this using a formula,
    > rather than filter or sort, as the data, and hence the blank cells, will
    > change, and I want to perform analysis on the cells containing data.




  3. #3
    Don Guillett
    Guest

    Re: Can I remove blanks from a range without using sort?

    a macro or
    make your selection>f5>special>blanks

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "Hugh Murfitt" <[email protected]> wrote in message
    news:[email protected]...
    > I have a range of cells A1:a10, say, which obtain data from another

    source.
    > Some of those cells a3, a6:a8, say, under certain conditions, will be

    blank.
    > How do I reorder this range such that the cells containing information

    are
    > listed together, removing the blanks? I want to do this using a formula,
    > rather than filter or sort, as the data, and hence the blank cells, will
    > change, and I want to perform analysis on the cells containing data.




  4. #4
    Hugh Murfitt
    Guest

    Re: Can I remove blanks from a range without using sort?

    I was hoping for a formula that would re-order automatically without losing
    data

    "R.VENKATARAMAN" wrote:

    > this is
    >
    > from one of the newsgroup correspondents
    >
    > use this code statement
    >
    > Range("a1:a10").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    >
    >
    >
    > =================================
    >
    > Hugh Murfitt <[email protected]> wrote in message
    > news:[email protected]...
    > > I have a range of cells A1:a10, say, which obtain data from another

    > source.
    > > Some of those cells a3, a6:a8, say, under certain conditions, will be

    > blank.
    > > How do I reorder this range such that the cells containing information

    > are
    > > listed together, removing the blanks? I want to do this using a formula,
    > > rather than filter or sort, as the data, and hence the blank cells, will
    > > change, and I want to perform analysis on the cells containing data.

    >
    >
    >


  5. #5
    Gord Dibben
    Guest

    Re: Can I remove blanks from a range without using sort?

    Hugh

    What type of analysing are you doing on the data?

    Most Functions will ignore blanks in a range.

    =SUM(A1:A10) ignores the blanks.

    To delete the blanks if desired..........

    Select A1:A10 then F5>Special>Blanks>OK

    Edit>Delete>Shift Up.


    Gord Dibben Excel MVP



    On Fri, 4 Mar 2005 03:43:03 -0800, Hugh Murfitt
    <[email protected]> wrote:

    >I have a range of cells A1:a10, say, which obtain data from another source.
    >Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
    > How do I reorder this range such that the cells containing information are
    >listed together, removing the blanks? I want to do this using a formula,
    >rather than filter or sort, as the data, and hence the blank cells, will
    >change, and I want to perform analysis on the cells containing data.



  6. #6
    Hugh
    Guest

    Re: Can I remove blanks from a range without using sort?

    {=INDEX(A$1:A$10,SMALL(IF(A$1:A$10<>0,ROW(A$1:A$10),""),ROW(A1:A1)))}
    (control-shift-enter) will work if they are really blanks. If the
    "blank" values are "" returned from elsewhere, they will remain "". If
    0 is returned, they will be removed.
    Note that your 1st reference must be to A1. Won't work if you use A2,
    for example.

    HTH



    Hugh Murfitt wrote:
    > I have a range of cells A1:a10, say, which obtain data from another source.
    > Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
    > How do I reorder this range such that the cells containing information are
    > listed together, removing the blanks? I want to do this using a formula,
    > rather than filter or sort, as the data, and hence the blank cells, will
    > change, and I want to perform analysis on the cells containing data.


  7. #7
    Hugh Murfitt
    Guest

    Re: Can I remove blanks from a range without using sort?

    This is EXACTLY what I wanted. Thanks a million for saving me a huge amount
    of time.

    "Hugh" wrote:

    > {=INDEX(A$1:A$10,SMALL(IF(A$1:A$10<>0,ROW(A$1:A$10),""),ROW(A1:A1)))}
    > (control-shift-enter) will work if they are really blanks. If the
    > "blank" values are "" returned from elsewhere, they will remain "". If
    > 0 is returned, they will be removed.
    > Note that your 1st reference must be to A1. Won't work if you use A2,
    > for example.
    >
    > HTH
    >
    >
    >
    > Hugh Murfitt wrote:
    > > I have a range of cells A1:a10, say, which obtain data from another source.
    > > Some of those cells a3, a6:a8, say, under certain conditions, will be blank.
    > > How do I reorder this range such that the cells containing information are
    > > listed together, removing the blanks? I want to do this using a formula,
    > > rather than filter or sort, as the data, and hence the blank cells, will
    > > change, and I want to perform analysis on the cells containing data.

    >


+ 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