Dear experts
I have set of data in sheet rawdata which is in row down as set of data need to copy column in separate header value
please find the attachment
Dear experts
I have set of data in sheet rawdata which is in row down as set of data need to copy column in separate header value
please find the attachment
![]()
Sub test() Dim r As Range, n As Long, x For Each r In Columns(1).SpecialCells(2, 1) If r.Text Like "##:##*" Then n = n + 1: x = Split(r(-2)) Cells(n + 1, "e").Resize(, 8) = Array(r(-2), r(-3), r(-1), r(0), r.Text, r(2), _ IIf(r(3) = "", 0, r(3).Text), x(UBound(x))) End If Next End Sub
Thanks for perfect code which is works amazing one thing which is not copy data till end of row where it ends of data
please find real data in xls
Hi
![]()
Sub test() Dim ar As Range Dim a As Variant Dim i As Long i = 1 For Each ar In Sheets("rawdata").Columns("A:A").SpecialCells(2, 23).Offset(1).Areas a = Application.Transpose(ar) ReDim Preserve a(1 To UBound(a) + 1) a(7) = IIf(a(7) = "", 0, a(7)) a(8) = Split(a(2), "$")(1) Sheets("EXPECTED Result").Cells(2 + i, 1).Resize(, 8) = Application.Index(a, 0, Array(2, 1, 3, 4, 5, 6, 7, 8)) i = i + 1 Next Sheets("EXPECTED Result").Columns("E").NumberFormat = "h:mm" End Sub
Last edited by mohadin; 04-11-2021 at 07:49 AM.
WorKs Amazing but small END WITH "error 9 subscript out of range"
Change
to![]()
If r.Text Like "##:##*" Then
![]()
If (r.Text Like "##:##") + (r.Text Like "#:##") Then
Thanks it works perfectly
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks