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
213 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 167 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 333 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 333 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

Technology Partners: 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

: Microsoft Office Collaborate for free and online versions of Microsoft  Word, Excel, Powerpoint, OneNote, Onedrive , Email, Calendar etc. In short we can say that Microsoft office is a suite of servers, applications and services developed by  Micr…
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

749 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