Solved

How can I convert a list of item based on starting date to show the history of each one

Posted on 2013-01-21
2
220 Views
Last Modified: 2013-01-22
Dear All,

How can I convert a list of item based on starting date to show the history of each one.

wellbore      Fluid      Date                  wellbore      Fluid      Date
SFNY-951      3.5      1/1/2013                  SFNY-951      3.5      1/1/2013
SFNY-952      7      1/2/2013                  SFNY-951      3.5      1/2/2013
SFNY-953      6      1/3/2013                  SFNY-951      3.5      1/3/2013
SFNY-954      5      1/4/2013                  SFNY-951      3.5      1/4/2013
SFNY-955      6.3      1/5/2013                  SFNY-951      3.5      1/5/2013
                              SFNY-952      7      1/2/2013
                              SFNY-952      7      1/3/2013
                              SFNY-952      7      1/4/2013
                              SFNY-952      7      1/5/2013
                              SFNY-953      6      1/3/2013
                              SFNY-953      6      1/4/2013
                              SFNY-953      6      1/5/2013
                              SFNY-954      5      1/4/2013
                              SFNY-954      5      1/5/2013
                              SFNY-955      6.3      1/5/2013


Please the attached sheet.

Regards,

Dallag
Production-Priority.xlsx
0
Comment
Question by:dallagmm
2 Comments
 
LVL 43

Accepted Solution

by:
Saqib Husain, Syed earned 500 total points
ID: 38804482
Try this macro

Sub wellbhistory()
    Dim sws As Worksheet
    Dim tws As Worksheet
    Dim cel As Range
    Dim tr As Long
    Dim i As Long
    Set sws = Sheet1
    Set tws = Sheet2
    edat = WorksheetFunction.Max(sws.Range("C:C"))
    For Each cel In sws.Range("A2:A" & sws.Range("A2").End(xlDown).Row)
        For i = cel.Offset(, 2) To edat
            tr = tws.Range("A" & Rows.Count).End(xlUp).Offset(1).Row
            cel.Resize(, 3).Copy tws.Cells(tr, 1)
            tws.Cells(tr, 3) = i
        Next i
    Next cel
End Sub

Open in new window

0
 

Author Closing Comment

by:dallagmm
ID: 38804532
Thank you it worked fine.

Regards,

Dallag
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Recently Microsoft released a brand new function called CONCAT. It's supposed to replace its predecessor CONCATENATE. But how does it work? And what's new? In this article, we take a closer look at all of this - we even included an exercise file for…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now