Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting Data


I have data in following format (this is just an extract, there are 60
rows
under headings A-F)

A
J1
J2
J3

B
J77
J65
J31

C
J22
J11
J9

........
So I have cost Centres, A -F ( these can be in any order), with Jo
numbers
below(always prefixed by J), there can be any number of Job numbers.




I need to get the above into the order:


J1 A
J2 A
J3 A


J77 B
J65 B
J31 B


J22 C
J11 C
J9 C

Many Thank

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56631

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Sorting Data

Sub ABC()
Dim rng as Range, cell as Range, ar as Range
set rng = Columns(1).SpecialCells(xlConstants)
for each ar in rng.Areas
for each cell in ar
if cell.row < ar(1).Row then
cell.offset(0,1).Value = ar(1).Value
end if
next cell
ar(1).ClearContents
next ar
End Sub


--
Regards,
Tom Ogilvy

"T De Villiers"
wrote in message
news:T.De.Villiers.2bq1ns_1154201108.0909@excelfor um-nospam.com...

I have data in following format (this is just an extract, there are 600
rows
under headings A-F)

A
J1
J2
J3

B
J77
J65
J31

C
J22
J11
J9

.......
So I have cost Centres, A -F ( these can be in any order), with Job
numbers
below(always prefixed by J), there can be any number of Job numbers.




I need to get the above into the order:


J1 A
J2 A
J3 A


J77 B
J65 B
J31 B


J22 C
J11 C
J9 C

Many Thanks


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile:
http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=566317



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Sorting Data


Thanks Tom, that works a treat


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=566317

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help sorting data Yookaroo Excel Worksheet Functions 4 June 30th 09 09:33 PM
Data Sorting Penrhos Excel Discussion (Misc queries) 9 January 30th 09 05:33 AM
Sorting data to put "0's" last Sue Excel Discussion (Misc queries) 16 October 29th 08 12:23 AM
Sorting data to match existing data Jack C Excel Discussion (Misc queries) 4 May 24th 06 09:48 AM
colors of bar charted data don't follow data after sorting Frankgjr Charts and Charting in Excel 2 January 17th 06 12:33 PM


All times are GMT +1. The time now is 04:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"