Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-11-2018, 07:44 AM
NoSparks NoSparks is offline How to sort multiple columns with pages Windows 7 64bit How to sort multiple columns with pages Office 2010 64bit
Excel Hobbyist
 
Join Date: Nov 2013
Location: British Columbia, Canada
Posts: 842
NoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of lightNoSparks is a glorious beacon of light
Default

Do you have both the Utility ID and GAMES sheets in the same workbook ?
If so, any others ?
Reply With Quote
  #2  
Old 08-11-2018, 07:52 AM
thumb thumb is offline How to sort multiple columns with pages Windows 10 How to sort multiple columns with pages Office 2013
Advanced Beginner
How to sort multiple columns with pages
 
Join Date: Aug 2018
Posts: 35
thumb is on a distinguished road
Default

Just those two. How do I post the code that I changed? It's the same code you gave me in the beginning just changed the name from Utility to GAMES in both places.


Ahh, got it....



Option Explicit

Sub Eight_To_Two_And_Back()
Dim src As Worksheet, dest As Worksheet
Dim r As Long, c As Long, x As Long
Dim ray As Variant

Set src = Sheets("GAMES")
Set dest = Sheets("ScratchPad")

dest.UsedRange.Delete

r = 1
For c = 1 To 10 Step 3
With src
ray = Range(.Cells(1, c), .Cells(Rows.Count, c + 1).End(xlUp)).Value
x = UBound(ray, 1)
End With
With dest
.Cells(r, 1).Resize(x, 2) = ray
r = r + x
End With
Next c
'sort
dest.Sort.SortFields.Clear
dest.Sort.SortFields.Add Key:=Range("A1:A" & Rows.Count).End(xlUp), _
SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With dest.Sort
.SetRange Range(dest.Range("A1"), dest.Range("B" & Rows.Count).End(xlUp))
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With

Call BackToEight

End Sub

Private Sub BackToEight()
Dim i As Long, lr As Long
Dim r As Long, c As Long
Dim src As Worksheet, dest As Worksheet

Set src = Sheets("ScratchPad")
Set dest = Sheets("GAMES")

dest.UsedRange.ClearContents

lr = src.Range("A" & Rows.Count).End(xlUp).Row
r = 1
c = 1

For i = 1 To lr Step 50
dest.Cells(r, c).Resize(50, 2).Value = src.Cells(i, 1).Resize(50, 2).Value
c = c + 3
If c = 13 Then
r = r + 50
c = 1
End If
Next i

End Sub
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to sort multiple columns with pages Macro to sort columns SerenityNetworks Excel Programming 4 09-02-2016 06:20 AM
.pdf to .xlsx - How to get sort-able columns? CCinPA Excel 0 07-05-2016 08:30 AM
How to sort multiple columns with pages Normal sort not bringing along other columns Dave Fraser Excel 2 06-06-2014 11:48 AM
quick replace, sort, change columns userman Excel 1 05-01-2012 06:24 AM
How to sort multiple columns with pages How to sort table having three columns? Bahir Barak Word 2 01-20-2011 01:52 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:03 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft