Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 26
Default Sorting data into different format....

http://www.neilcarden.co.uk/example.xls

Please see above file... I have a sheet (import) which is tha raw report from an application, I want to sort it in a similar way to LOOKUPs where it looks for the agents name, and returns the data as in sheet 2 (Formatted).

How easy is this to do? as some days not all the codes will be used so the raw data will not always be in the same format regarding number of rows before going onto next person etc...

Thanks in advance
Neil.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 42
Default Sorting data into different format....

Neil

This is a general forum you should enter the data here so every one can see
the problem. However, I downloaded your file and have written a macro to
solve your problem.

Option Base 1
Sub FormatData()
Dim x, c, r As Long, nr As Long
Dim col As Integer, ncol As Integer
Dim rng As Range
Worksheets("imported").Select
Application.ScreenUpdating = True
' set up the headers to look up
x = Array("Break", "Office", "Duty Senior", "Meeting", _
"Development", "Read Time", "CPVA", "Not Ready")
nr = Range("A2").CurrentRegion.Rows.Count
r = 3
Set rng = Range(Cells(2, 1), Cells(nr, 1))

Worksheets("formatted").Select
ActiveSheet.Cells.Clear
Range("B3:I3") = x
On Error Resume Next
' find each employee by works#
For Each c In rng
If IsNumeric(Right(c, 4)) * 1 Then
r = r + 1
Cells(r, 1) = c
End If

' check column A against headers X
For i = 1 To 8
If x(i) = c Then
Cells(r, i + 1) = c.Offset(0, 1)
End If
Next i
Next c
Range("A3:I3").Select
Selection.Font.Bold = True
Selection.CurrentRegion.Select
Selection.Columns.AutoFit
Range("A3").Select

Application.ScreenUpdating = True
End Sub

any problems contact me


"neilcarden" wrote:


http://www.neilcarden.co.uk/example.xls

Please see above file... I have a sheet (import) which is tha raw
report from an application, I want to sort it in a similar way to
LOOKUPs where it looks for the agents name, and returns the data as in
sheet 2 (Formatted).

How easy is this to do? as some days not all the codes will be used so
the raw data will not always be in the same format regarding number of
rows before going onto next person etc...

Thanks in advance
Neil.




--
neilcarden

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
Input data format from GIS Khoshravan Excel Discussion (Misc queries) 1 May 19th 06 10:05 AM
sorting data and automatic graphs timc Charts and Charting in Excel 3 January 27th 06 08:37 PM
Inserting a new line when external data changes Rental Man Excel Discussion (Misc queries) 0 January 11th 06 07:05 PM
Convert data into standard military time format geog Excel Discussion (Misc queries) 2 December 12th 05 07:46 PM
Sorting Data that feeds into other formulas.... Kittine Excel Discussion (Misc queries) 1 July 26th 05 08:21 PM


All times are GMT +1. The time now is 04:52 AM.

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"