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


Thanks tdw. This is what I came up with:

Sub re_organise()

Sheets("Sheet1").Select

i = 2
j = 2
Do While Cells(i, 1) < ""
If Cells(i, 1) < Cells(i + 1, 1) Then
Sheets("Sheet2").Cells(j, 1) = Cells(i - 1, 1).Value
Sheets("Sheet2").Cells(j, 2) = Cells(i - 1, 2).Value
Sheets("Sheet2").Cells(j, 3) = Cells(i - 1, 3).Value
Sheets("Sheet2").Cells(j, 4) = Cells(i, 2).Value
Sheets("Sheet2").Cells(j, 5) = Cells(i, 3).Value
End If
i = i + 1
j = j + 1
Loop

Sheets("Sheet2").Range("A:A").SpecialCells(xlCellT ypeBlanks).EntireRow.Delete


End Sub

I'm sure there are better and more elegant solutions especially since
I'm having to sort the data by ID and then by date for this to work.

Utkarsh

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
Rearranging DATA raj74 Excel Discussion (Misc queries) 6 April 12th 09 12:11 PM
Rearranging data Witold Excel Discussion (Misc queries) 6 May 15th 07 02:54 PM
rearranging data [email protected] Excel Worksheet Functions 4 April 4th 07 10:32 PM
Rearranging Data Help... Jambruins Excel Discussion (Misc queries) 0 February 22nd 05 03:31 PM
rearranging data Mark Roach Excel Programming 9 December 20th 04 03:14 PM


All times are GMT +1. The time now is 08:28 PM.

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

About Us

"It's about Microsoft Excel"