Public Sub test()
Application.ScreenUpdating = False
Dim b As Long
Cells.Clear
ActiveWindow.DisplayGridlines = False
R1 = "#,Desc,Desc2,Refrenace No.,Desc,Rev0,,,,Rev1,,,,Rev2,,,,Rev3,,,,Rev4,,,,Rev5,,,,Remarks"
R2 = ",,,,,Date Sub,Date Rec,Days,Code,Date Sub,Date Rec,Days,Code,Date Sub,Date Rec,Days,Code,Date Sub,Date Rec,Days,Code,Date Sub,Date Rec,Days,Code,Date Sub,Date Rec,Days,Code,"
R3 = "1,dsdfdsf,sfdsf,xx-xx-xx-00001,ar,01-jan-19,05-jan-19,4,C,07-jan-19,10-jan-19,3,C,12-Jan-19,15-jan-19,3,B,,,,,,,,,,,,,"
R4 = "2,hjhjhgj,vcvbcvb,xx-xx-xx-00002,ar,01-jan-19,10-Jan-19,9,C,12-Jan-19,15-Jan-19,3,C,16-jan-19,20-jan-19,4,C,21-Jn-19,25-Jn-19,4,B,,,,,,,,,"
TR = R1 & ";" & R2 & ";" & R3 & ";" & R4
For R = 2 To 5
For c = 1 To 30
With Cells(R, c)
If R = 2 And (c <= 5 Or c = 30) Then .Resize(2, 1).Merge
If R = 2 And (c = 6 Or c = 10 Or c = 14 Or c = 18 Or c = 22 Or c = 26) Then .Resize(1, 4).Merge
.Value = Split(Split(TR, ";")(R - 2), ",")(c - 1)
End With
Next
Next
Cells.EntireColumn.AutoFit
'COLOR
With Cells(2, 1).Resize(2, 30)
With .Interior
.Pattern = xlSolid
.Color = RGB(253, 233, 217)
End With
End With
'Borders
With Cells(2, 1).Resize(5, 30)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
For b = 7 To 12
With .Borders(b)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlHairline
End With
Next
End With
[SIZE=4][B][COLOR=#ff0000]'''' Here need you to do some touch[/COLOR][/B][/SIZE]
[B8] = "=CONCATENATE(B4,"","",C4,"","",D4,"","",E4)"
[C8] = "=IF(F4<>"""",""*""&CONCATENATE(TEXT(F4,""dd-mmm-yy""),"","",TEXT(G4,""dd-mmm-yy""),"","",H4,"","",I4)&"";"","""")&IF(J4<>"""",""*""&CONCATENATE(TEXT(J4,""dd-mmm-yy""),"","",TEXT(K4,""dd-mmm-yy""),"","",L4,"","",M4)&"";"","""") &IF(N4<>"""",""*""&CONCATENATE(TEXT(N4,""dd-mmm-yy""),"","",TEXT(O4,""dd-mmm-yy""),"","",P4,"","",Q4)&"";"","""")&IF(R4<>"""",""*""&CONCATENATE(TEXT(R4,""dd-mmm-yy""),"","",TEXT(S4,""dd-mmm-yy""),"","",T4,"","",U4)&"";"","""") &IF(V4<>"""",""*""&CONCATENATE(TEXT(V4,""dd-mmm-yy""),"","",TEXT(W4,""dd-mmm-yy""),"","",X4,"","",Y4)&"";"","""")&IF(Z4<>"""",""*""&CONCATENATE(TEXT(Z4,""dd-mmm-yy""),"","",TEXT(AA4,""dd-mmm-yy""),"","",AB4,"","",AC4)&"";"","""")"
[B9] = "=CONCATENATE(B5,"","",C5,"","",D5,"","",E5)"
[C9] = "=IF(F5<>"""",""*""&CONCATENATE(TEXT(F5,""dd-mmm-yy""),"","",TEXT(G5,""dd-mmm-yy""),"","",H5,"","",I5)&"";"","""")&IF(J5<>"""",""*""&CONCATENATE(TEXT(J5,""dd-mmm-yy""),"","",TEXT(K5,""dd-mmm-yy""),"","",L5,"","",M5)&"";"","""") &IF(N5<>"""",""*""&CONCATENATE(TEXT(N5,""dd-mmm-yy""),"","",TEXT(O5,""dd-mmm-yy""),"","",P5,"","",Q5)&"";"","""")&IF(R5<>"""",""*""&CONCATENATE(TEXT(R5,""dd-mmm-yy""),"","",TEXT(S5,""dd-mmm-yy""),"","",T5,"","",U5)&"";"","""") &IF(V5<>"""",""*""&CONCATENATE(TEXT(V5,""dd-mmm-yy""),"","",TEXT(W5,""dd-mmm-yy""),"","",X5,"","",Y5)&"";"","""")&IF(Z5<>"""",""*""&CONCATENATE(TEXT(Z5,""dd-mmm-yy""),"","",TEXT(AA5,""dd-mmm-yy""),"","",AB5,"","",AC5)&"";"","""")"
[B11] = "=SUBSTITUTE(C8,""*"",B8&"","")"
[B12] = "=SUBSTITUTE(C9,""*"",B9&"","")"
[B14] = "=CONCATENATE(B11,B12)"
''''''''''''''''''''''''''''''''''''''''''''
On Error Resume Next ' may it Long not work
Range("B16:L40").FormulaArray = "=TRIM(MID(SUBSTITUTE(IFERROR(MID(B$14,FIND(""|"",SUBSTITUTE("";""&B$14&"";"","";"",""|"",(ROW()-ROW(B$16)+1))),FIND("";"",B$14&"";"",FIND(""|"",SUBSTITUTE("";""&B$14&"";"","";"",""|"",(ROW()-ROW(B$16)+1))))-FIND(""|"",SUBSTITUTE("";""&B$14&"";"","";"",""|"",(ROW()-ROW(B$16)+1)))),""""),"","",REPT("" "",99)),(COLUMN()-COLUMN(B$16)+1)*99-98,99))"
On Error GoTo 0
'''''''''''''''''''' workwill
Range("B16:L40").FormulaArray = "=TRIM(MID(SUBSTITUTE(TRIM(MID(SUBSTITUTE(B14,"";"",REPT("" "",999)),(ROW()-ROW(B$16)+1)*999-998,999)),"","",REPT("" "",999)),(COLUMN()-COLUMN(B$16)+1)*999-998,999))"
'COLOR
With Cells(15, 1).Resize(1, 10)
With .Interior
.Pattern = xlSolid
.Color = RGB(253, 233, 217)
End With
End With
'Borders
With Cells(15, 1).Resize(15, 10)
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
For b = 7 To 12
With .Borders(b)
.LineStyle = xlContinuous
.ColorIndex = 0
.TintAndShade = 0
.Weight = xlHairline
End With
Next
End With
Application.ScreenUpdating = False
End Sub