Solved

How can I sort the attached spreadsheet so that the entries in the Applications column that say "[Can't connect to or ping]" are grouped at the bottom of the spreadsheet?

Posted on 2011-03-16
3
209 Views
Last Modified: 2012-05-11
How can I sort the attached spreadsheet so that the entries in the Applications column that say "[Can't connect to or ping]" are grouped at the bottom of the spreadsheet?

I need these to be moved and for the corresponding data in the other rows to remain properly grouped together.
Inventory.xlsx
0
Comment
Question by:Knowledgeable
  • 2
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 167 total points
Comment Utility
One way to do it is with a helper column containing this formula:

   =IF(D2="[Can't connect to or ping]","ZZZZ",D2)

Sort on the helper column.

See attached.

Kevin
Inventory.xlsx
0
 
LVL 39

Assisted Solution

by:nutsch
nutsch earned 333 total points
Comment Utility
Try this code

Sub Macro4()
 Application.ScreenUpdating = False

    Columns("A:A").Insert
    Range("A2:A" & Cells(Rows.Count, 2).End(xlUp).Row).FormulaR1C1 = "=IF(RC[4]=""[Can't connect to or ping]""," & Rows.Count & ",ROW())"
    ActiveSheet.Sort.SortFields.Clear
    ActiveSheet.Sort.SortFields.Add Key:=Range("A2"), _
        SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
        xlSortTextAsNumbers
    With ActiveSheet.Sort
        .SetRange Range("A2:F22")
        .Header = xlNo
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
    Columns("A:A").Delete
    
    
    Application.ScreenUpdating = True
    
End Sub

Open in new window


Thomas
0
 
LVL 39

Assisted Solution

by:nutsch
nutsch earned 333 total points
Comment Utility
My code does the same thing as the helper column mentioned by Kevin, but using the below formula, doing the sort and removing the column afterwards.

   =IF(D2="[Can't connect to or ping]","ZZZZ",row())

Thomas
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now