Hi there this is a repost of my problem last night since my first post was wrongly done... anyhow here's my problem:
i have this data that have lots of duplicate rows wherein they are the date a certain employee have had his time punch what i want to accomplish is that each date would be having only one row of 2 punch_in and 2 punch out.
here's my workbook: for testing.xlsm
simply put i want my the data in my rawdata sheet to appear like the one i have in sheet1
also i found a working code here though it yields an almost similar result though its not the one that i needed
here's the code:
thank you in advance for your help![]()
Sub x() Dim rInput As Range, oDic As Object, sNames() As String, vInput() Dim i As Long, nIndex As Long Set rInput = Range("A1", Range("B65536").End(xlUp)) vInput = rInput.Value ReDim sNames(1 To UBound(vInput, 1), 1 To 2) Set oDic = CreateObject("Scripting.Dictionary") With oDic For i = 1 To UBound(vInput, 1) If Not .Exists(vInput(i, 1)) Then nIndex = nIndex + 1 sNames(nIndex, 1) = vInput(i, 1) sNames(nIndex, 2) = vInput(i, 2) .Add vInput(i, 1), nIndex ElseIf .Exists(vInput(i, 1)) Then sNames(.Item(vInput(i, 1)), 2) = sNames(.Item(vInput(i, 1)), 2) & ", " & vInput(i, 2) End If Next i End With Cells(1, "H").Resize(nIndex, 2) = sNames ' The line below if you want the words in separate columns ' otherwise they are in a single cell, separated by commas Cells(1, "I").Resize(nIndex).TextToColumns , comma:=True End Sub![]()











LinkBack URL
About LinkBacks


Register To Reply
Bookmarks