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

Monthly I receive an excel file that looks as so:

A B C D E
1 Dept Code Date Amt Comment
2 977 123 4/05/04 100.00 asdf
3 877 234 4/03/04 90.00 sdfg
4 777 345 4/05/04 80.00 fghjgh
5 ABCD
6 877 222 4/03/04 110.00 ytry
7 777 333 4/01/04 75.00 wer
8 666 444 4/05/04 65.00 nbvc
9 555 988 4/06/04 83.00 kjlkj
10 435 922 4/06/04 125.00 lkjklj
11 555 834 4/11/04 111.00 lkj
12 DERB
.............

Above are only Two Blocks of maybe 100 Blocks;
Example Block 1 (above) has 3 lines and Block 2 has 6 lines.
A Block **CAN BE** only 1 line of data
But each block is followed by a code in Column D that applys
to each item in the block Above it.

For starters I have inserted a column Before Col A Above thinking
I could enter in new A2 an Offset() function that could somehow
bring back the "ABCD" Value.. Same in A3 that would bring back
the "ABCD: Value.

After mulling over I haven't got a clue where to begin on this.
Can anyone assist with a plan?
TIA,






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Rearrangement of reported data

Hi JMay,

Try:

Sub Tester()

Dim ar As Range
ActiveSheet.Range("A1").EntireColumn.Insert
For Each ar In Columns(2) _
.SpecialCells(xlCellTypeConstants).Areas

ar.Offset(0, -1) = _
ar(ar.Cells.Count).Offset(1, 3)
Next

End Sub

---
Regards,
Norman


"JMay" wrote in message
news:mSpmc.4865$nN6.3246@lakeread06...
Monthly I receive an excel file that looks as so:

A B C D E
1 Dept Code Date Amt Comment
2 977 123 4/05/04 100.00 asdf
3 877 234 4/03/04 90.00 sdfg
4 777 345 4/05/04 80.00 fghjgh
5 ABCD
6 877 222 4/03/04 110.00 ytry
7 777 333 4/01/04 75.00 wer
8 666 444 4/05/04 65.00 nbvc
9 555 988 4/06/04 83.00 kjlkj
10 435 922 4/06/04 125.00 lkjklj
11 555 834 4/11/04 111.00 lkj
12 DERB
............

Above are only Two Blocks of maybe 100 Blocks;
Example Block 1 (above) has 3 lines and Block 2 has 6 lines.
A Block **CAN BE** only 1 line of data
But each block is followed by a code in Column D that applys
to each item in the block Above it.

For starters I have inserted a column Before Col A Above thinking
I could enter in new A2 an Offset() function that could somehow
bring back the "ABCD" Value.. Same in A3 that would bring back
the "ABCD: Value.

After mulling over I haven't got a clue where to begin on this.
Can anyone assist with a plan?
TIA,








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 422
Default Rearrangement of reported data

Norman:
Thanks for the code; It works great!!
JMay

"Norman Jones" wrote in message
...
Hi JMay,

Try:

Sub Tester()

Dim ar As Range
ActiveSheet.Range("A1").EntireColumn.Insert
For Each ar In Columns(2) _
.SpecialCells(xlCellTypeConstants).Areas

ar.Offset(0, -1) = _
ar(ar.Cells.Count).Offset(1, 3)
Next

End Sub

---
Regards,
Norman


"JMay" wrote in message
news:mSpmc.4865$nN6.3246@lakeread06...
Monthly I receive an excel file that looks as so:

A B C D E
1 Dept Code Date Amt Comment
2 977 123 4/05/04 100.00 asdf
3 877 234 4/03/04 90.00 sdfg
4 777 345 4/05/04 80.00 fghjgh
5 ABCD
6 877 222 4/03/04 110.00 ytry
7 777 333 4/01/04 75.00 wer
8 666 444 4/05/04 65.00 nbvc
9 555 988 4/06/04 83.00 kjlkj
10 435 922 4/06/04 125.00 lkjklj
11 555 834 4/11/04 111.00 lkj
12 DERB
............

Above are only Two Blocks of maybe 100 Blocks;
Example Block 1 (above) has 3 lines and Block 2 has 6 lines.
A Block **CAN BE** only 1 line of data
But each block is followed by a code in Column D that applys
to each item in the block Above it.

For starters I have inserted a column Before Col A Above thinking
I could enter in new A2 an Offset() function that could somehow
bring back the "ABCD" Value.. Same in A3 that would bring back
the "ABCD: Value.

After mulling over I haven't got a clue where to begin on this.
Can anyone assist with a plan?
TIA,










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
Valid Hyperlinks being reported as Invalid Steve Links and Linking in Excel 0 December 23rd 08 04:45 AM
Difference between time in excel reported incorrectly Jon Excel Discussion (Misc queries) 6 December 19th 08 04:23 PM
Too many messages reported Barrie Excel Discussion (Misc queries) 3 August 22nd 08 01:46 AM
Unique names in a list reported everyday Anurag Excel Worksheet Functions 3 November 8th 07 08:46 PM
Date Created reported as wrong Tom Ogilvy Excel Programming 1 July 21st 03 04:33 AM


All times are GMT +1. The time now is 10:37 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"