+ Reply to Thread
Results 1 to 3 of 3

Stock price list merged by date wise from one sheet to another sheet by macro

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Stock price list merged by date wise from one sheet to another sheet by macro

    Dear all, this is nur once again! I have two work sheet , input sheet (where data will be past) & output (where my desire results will be display). There is a popular sentence something like this ,a picture tells Thousand of speech !, please check the attachment where I have tried to explain by color mark & arrow sign . take care everybody …. nur
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Stock price list merged by date wise from one sheet to another sheet by macro

    Sub test()
        Dim a, i As Long, n As Long, myDate
        With Sheets("input")
            a = .Range("a1", .Range("a" & .Rows.Count).End(xlUp)).Value
        End With
        With CreateObject("VBScript.RegExp")
            .Pattern = "^([^\|]+)" & Application.Rept(" *\| *(\-?\d+(\.\d+)?)", 9) & "$"
            For i = 1 To UBound(a, 1)
                If IsDate(a(i, 1)) Then myDate = a(i, 1)
                If IsDate(myDate) Then
                    If .test(a(i, 1)) Then
                        n = n + 1
                        a(n, 1) = .Replace(a(i, 1), "$1,-," & _
                        Format$(myDate, "ddmmyyyy") & ",$2,$4,$6,$8,$16")
                    End If
                End If
            Next
        End With
        Sheets("output").Cells(1).Resize(n).Value = a
    End Sub

  3. #3
    Forum Contributor
    Join Date
    06-08-2012
    Location
    BD
    MS-Off Ver
    Microsoft Office 2016
    Posts
    640

    Re: Stock price list merged by date wise from one sheet to another sheet by macro

    Hi Jindon , it works great. I always appreciate your job, specially its data processing speed is awesome, thanks for your valuable time, take care. ..nur

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1