Sub Powerpoint_maken()
Call Afbeelding_invoegen 'MACRO OUTPUT GEEFT ZOALS VOORBEELD BESTAND
Dim lastRow As Long
lastRow = Range("B" & Rows.Count).End(xlUp).Row
Columns("B:B").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Columns("B:B").Font.ThemeColor = xlThemeColorLight1
With Range("B2")
.FormulaR1C1 = "=RC[1]&" - "&RC[2]" 'SAMENVOEGEN ARTIKELNUMMER EN ARTIKELNAAM
.AutoFill Destination:=Range("B2:B" & lastRow)
End With
Columns("E:E").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
With Range("E2")
.FormulaR1C1 = "=RC[1]&CHAR(10)&RC[2]&CHAR(10)&RC[3]&CHAR(10)&RC[4]&CHAR(10)&RC[5]&CHAR(10)&RC[6]" 'SAMENVOEGEN SPECIFICATIES ARTIKELEN
.HorizontalAlignment = xlLeft
.VerticalAlignment = xlCenter
.WrapText = True
.AutoFill Destination:=Range("E2:E" & lastRow)
End With
Range("B1,E1").Value = "temp"
'ORIGINELE CODE
sn = Blad1.Cells(1).CurrentRegion
With CreateObject("PowerPoint.Application")
With .Presentations.Add
For j = 2 To UBound(sn)
With .Slides.Add(j - 1, 12)
.Shapes.AddPicture sn(j, 1), True, False, 20, 20, 400, 400
.Shapes.AddTextbox(1, 5, 450, 400, 50).TextEffect.Text = sn(j, 3) 'TEKSTVAK ARTIKELNUMMER EN ARTIKELNAAM
.Shapes.AddTextbox(1, 5, 450, 400, 50).TextEffect.Text = sn(j, 5) 'TEKSTVAK ARTIKELSPECIFICATIES
End With
Next
End With
.Visible = True
End With
End Sub