Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with code to re-arrange data for pareto analysis

Thanks Bob ...This works a treat ...


"Bob Phillips" wrote in message
...
Steve,

Here is some code.

Sub Test()
Dim iLastRow As Long
Dim iLastCol As Long
Dim i As Long, j As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 1 Step -1
iLastCol = Cells(i, Columns.Count).End(xlToLeft).Column
For j = iLastCol To 3 Step -1
Rows(iLastRow + 1).Insert
Cells(iLastRow + 1, "A").Value = Cells(i, "A").Value
Cells(iLastRow + 1, "B").Value = Cells(i, j).Value
Cells(i, j).Value = ""
Next j
Next i

End Sub

To add it, go to the VBIDE, Alt-F11, insert a code module, InsertModule,
and paste the code.

Go back to Excel, and run the macro, ToolsMacroMacros... and select the
macro and press Run.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Steve S" <not@home wrote in message
...
Hi all,

As I have no VBA experience, please would it be possible for someone to

help
me with a problem I cannot easily solve. I would be grateful if someone
could point me in the right direction with some code.


I have the following data sheet : Four columns A,B,C,D - Not limited to

3
rows could be many hundreds and a different number each time the code is
run. Column A always has a date - Columns B,C and D have error codes -
sometimes one of the B,C or D can be blank, but never all three. I

would
like to do pareto analysis by date on the collected error codes so
ultimately I would like on a seperate sheet - two columns A and B - A
containing the date and B containing the all the error codes. I can

remove
rows which are blank in col B at a later stage.

A B C D
1/1/06 AA BB CC
3/1/06 BB
9/1/06 AA EE



I would like code that translates it to :

A B
1/1/06 AA
3/1/06 BB
9/1/06 AA
1/1/06 BB
3/1/06
9/1/06 EE
1/1/06 CC
3/1/06
9/1/06


Thank you for any help that would point me in the right direction for
solving this problem I have.

Regards

Steve






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
Automatic Pareto data with Formula GCRDelphi Excel Discussion (Misc queries) 1 April 20th 10 01:58 AM
Is excel capable of Pareto analysis? chupa2020 Excel Discussion (Misc queries) 2 October 29th 09 03:25 PM
Analysis Toolpak-Confidence Level and data analysis questions MH Excel Worksheet Functions 0 January 3rd 09 06:15 PM
Pareto of data Dave Excel Discussion (Misc queries) 2 October 26th 06 02:23 PM
Analysis ToolPak installed but no Data Analysis option Eric Stephens Excel Discussion (Misc queries) 3 February 2nd 05 09:17 PM


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