• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vba help in seperate data datawise

Status
Not open for further replies.

Malleshg24

New Member
Hi Team,

Need your help in VBA seperating Data Datewise.

Column B Contains Files Received Dates it will in ascending order
I want to see date wise file Received, from Vertically to horizontally. as shown expected output from Column E.

Dates are in text when checked with isnumber. Date column May Increased.


Attached input file and expected output from Column E.

Thanks in advance for your help!


Regards,
mg
 

Attachments

  • Seperate Data.xlsx
    12.1 KB · Views: 11
If the following presentation is acceptable, then the Mcode that follows will solve your issue. This is a Power Query Solution.

vABCD
1ABC File Name1/10/20201/15/20201/20/2020
2Capegemini zipWipro zip
3Infosys rmt zipReliance zip
4Infosys zipWipro zipcapegemini.zip
5Wipro. zipInfosys.zipReliance zip

Code:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"ABC File Name", type text}, {"Received Dates", type date}, {"XYZ File Name", type text}}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Changed Type", {{"Received Dates", type text}}, "en-US"), List.Distinct(Table.TransformColumnTypes(#"Changed Type", {{"Received Dates", type text}}, "en-US")[#"Received Dates"]), "Received Dates", "XYZ File Name")
in
    #"Pivoted Column"
 
Hi !​
According to your attachment a beginner starter demonstration :​
Code:
Sub Demo1()
        Dim V, C&, F&, L&
        [E1].CurrentRegion.Clear
        Application.ScreenUpdating = False
    With [A1].CurrentRegion.Columns(2)
           .AdvancedFilter xlFilterCopy, , [E1], True
            V = Range("E2", [E1].End(xlDown)).Value2
            [E1].CurrentRegion.Clear
            [A1,C1].Copy [E2].Resize(, UBound(V) * 2)
        For C = 1 To UBound(V)
            F = .Find(V(C, 1)).Row
            L = .Find(V(C, 1), , , , , xlPrevious).Row
        With Cells(3 + C * 2).Resize(, 2)
             Cells(F, 2).Copy .Cells(1)
            .Cells(2).Interior.Color = .Cells(1).Interior.Color
            .HorizontalAlignment = xlCenterAcrossSelection
        End With
            Range("A" & F & ":A" & L & ",C" & F & ":C" & L).Copy Cells(3, 3 + C * 2)
        Next
    End With
        Application.ScreenUpdating = True
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Suggest you look at the link in my signature block. Additionally, you should buy the book. M is for (Data) Monkey by Ken Puls and Miguel Escobar. You don't want to be left not knowing this powerful Excel function that will make your life easier. It is part of the future of Excelling.
 
And as we are in the VBA section and as another section for Power Query yet exists in this forum​
so it should be smarter to ask the OP before to post any Power Query solution​
and in that case a moderator can move the thread to the appropriate section,​
more content for anyone smart enough to search in the Power Query section …​
Thanks.​
 
Status
Not open for further replies.
Back
Top