Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-17-2015, 03:35 AM
kw01 kw01 is offline Linking cells: can sub-cells move with their master-cell when sorting? Windows 7 32bit Linking cells: can sub-cells move with their master-cell when sorting? Office 2013
Novice
Linking cells: can sub-cells move with their master-cell when sorting?
 
Join Date: Jun 2015
Posts: 1
kw01 is on a distinguished road
Default Linking cells: can sub-cells move with their master-cell when sorting?

I hope I can explain myself, but is there a way of linking 'sub-folders/lines' with their respective 'folder/line' so that when you do an alphabetical sort, the 'sub-folder/lines' stay with their respective 'folder/line/master'? I have attached a before and after example (I hope you can see it). The table basically looks like the one below, but sorted by City. If I were to sort by Rep, how could I design it so the entries University, Shop, Hotel, etc stay with their respective 'master'? I apologise if this is difficult to understand.



Rep 1 Oxford
University
Hotel

Rep 2 Glasgow
Hotel
Shop

Rep 1 London
Office
Boat
Attached Files
File Type: xlsx Excel example.xlsx (8.9 KB, 10 views)

Last edited by kw01; 06-17-2015 at 06:16 AM.
Reply With Quote
  #2  
Old 06-30-2015, 05:02 PM
charlesdh charlesdh is offline Linking cells: can sub-cells move with their master-cell when sorting? Windows 7 32bit Linking cells: can sub-cells move with their master-cell when sorting? Office 2010 32bit
Expert
 
Join Date: Apr 2014
Location: Mississippi
Posts: 382
charlesdh is on a distinguished road
Default

HI,

You can do a "Custom" sort.
Here is a Recorded macro based on you sample

Code:
Sub Macro1()
'
' Macro1 Macro

    
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A3:A16") _
        , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
        .SetRange Range("A3:B16")
        .Header = xlGuess
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking cells: can sub-cells move with their master-cell when sorting? Move emails from one folder to another smiler44 Outlook 9 11-20-2014 03:02 PM
Linking cells: can sub-cells move with their master-cell when sorting? Move files from one folder to another obasanla Word 1 09-28-2012 04:42 PM
Move conversation to folder after replying karlads Outlook 0 01-28-2012 12:52 PM
Linking cells: can sub-cells move with their master-cell when sorting? Rule to move sent messages to a specific folder LouisOscar Outlook 1 08-17-2011 05:42 AM
How to move pics in excel to another folder? SPI Excel 1 08-19-2008 11:58 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:36 PM.


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