![]() |
|
#1
|
|||
|
|||
![]() This is better. Make sure you save your workbook as macro enabled (.xlsm) after copying the code into it, Code:
Sub Try_This_A() Dim lc As Long, lr As Long lc = Cells.Find("*", SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column lr = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row Application.ScreenUpdating = False With Range(Cells(1, 1), Cells(lr, lc)) .SpecialCells(4).Delete -4162 End With Rows("1:1").Insert Shift:=xlDown Range(Cells(1, 1), Cells(1, lc)).FormulaR1C1 = "=COUNTA(R[2]C:R[15]C)" ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range(Cells(1, 1), Cells(1, lc)), _ SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal With ActiveWorkbook.Worksheets("Sheet1").Sort .SetRange Range(Cells(1, 1), Cells(lr + 1, lc)) .Header = xlGuess .MatchCase = False .Orientation = xlLeftToRight .SortMethod = xlPinYin .Apply End With Rows("1:1").Delete Application.ScreenUpdating = False End Sub |
#2
|
|||
|
|||
![]()
@brenna.at.work
Did you get your workbook to work with any of the solutions offered? |
#3
|
|||
|
|||
![]()
Probably a cross poster and got their answer elsewhere!
|
![]() |
Tags |
data, probz, sorting |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jyfuller | Excel | 10 | 06-19-2013 05:31 PM |
![]() |
Bahir Barak | Word | 2 | 01-20-2011 01:52 PM |
Can I do this? sorting data in seperate columns | shumonsaha | Excel | 0 | 07-04-2010 03:05 AM |
CAUTION!! Sorting a spreadsheet with hidden columns will trash your data. | psmaster@earthlink.net | Excel | 0 | 11-24-2009 11:54 AM |
Sorting columns in Excel - please advise | Jonre | Excel | 2 | 08-21-2009 02:38 AM |