LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default Help with VBA/macro for Excel data

Hi,

For simplicity, the following is based on the basic data starting in A1 i,e,
cells(1, 1)
It works by copying the second data block to the cell next to the first
block (Column 7), deleting the row containing the second data block and
repeating for the next block until a row is encountered where the first
column contains a blank.

Sub DataLayout()
Dim Rw, Col
Rw = 2
Do
Range(Cells(Rw, 1), Cells(Rw, 6)).Copy Cells(Rw - 1, 7)
Rows(Rw).EntireRow.Delete
Rw = Rw + 1
Loop Until IsEmpty(Cells(Rw, 1))
End Sub

Note that the procedure ends when a blank cell occurs in Column 1.

Hope that starts you off.

Regards,
Don

"MB" wrote in message
om...
Thanks in advance.

I have the following data that I need to manipulate. I am proficient
with Excel formulas (or so I thought), but I can not think of one to
use. Maybe a VBA/macro will do the trick. I am not familiar with much
if any VBA.

I have 20,000+ rows of data. The monthly data came in double stacked
(in 2 rows). Feb - Jul over top of Aug - Jan. I would like the data
Feb - Jan in a single row. In the first column the numbers repeat 1,1,
then 2,2, then 3,3... The columns represent the months. I need to cut
the data out of the 2nd occurance of the row number and paste it at
the end of the 1st occurance. Then delete the row. Then move to the
next number and repeat. Email with questions.

A sample of the data:
FEB MAR APR MAY JUN JUL
AUG SEP OCT NOV DEC JAN

1 -63 62 96 93 -64 -29
1 66 -21 -63 -78 -84 -24
2 -12 80 10 66 31 14
2 22 -22 36 40 -69 11
3 -56 15 80 -30 38 -38
3 28 84 -17 16 -12 14



 
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
Write Macro to Fix Data Alignment (Data dump from Crystal to Excel Karin Excel Discussion (Misc queries) 2 September 22nd 09 05:31 PM
macro to get data from one application into excel whatzzup Excel Discussion (Misc queries) 1 April 29th 08 04:56 PM
Macro to check data from excel list against access query and return value back to excel dreamkeeper Excel Worksheet Functions 0 October 31st 07 07:26 PM
internet connection via excel macro at timed intervels & save data to excel file. Sam Excel Worksheet Functions 1 July 22nd 07 06:08 AM
Excel OLE data in PPT reverting to OLD data after macro updation Hari Prasadh Charts and Charting in Excel 12 August 4th 05 04:46 PM


All times are GMT +1. The time now is 05:02 AM.

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"