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
222 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access Open Report with SQL Parameter 11 30
And OR formula 5 22
EXCEL formual to calculate Quarter 6 36
Data Copy 4 22
As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

770 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