?
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
Medium Priority
?
217 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 668 total points
ID: 35152905
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 1332 total points
ID: 35152909
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 1332 total points
ID: 35152919
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
New style of hardware planning for Microsoft Exchange server.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

770 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