Onderstaande macro gebruik ik om een gedeelte uit een cell waarin alt+enters in zitten.
Nu probeer ik een gedeelte toe te voegen. Alleen krijg ik nu de foutmelidng 424 (Object vereist).
Het gaat om de rode regel waarop de vba fast loopt.
Nu probeer ik een gedeelte toe te voegen. Alleen krijg ik nu de foutmelidng 424 (Object vereist).
Het gaat om de rode regel waarop de vba fast loopt.
Code:
Private Sub CommandButton2_Click()
Dim TempArray1 As Variant, Loc1 As String, LastRow As Long, n As Long
LastRow = ActiveSheet.Range("E" & Rows.Count).End(xlUp).Row
For n = 2 To LastRow
Loc1 = ActiveSheet.Range("E" & n).Value
If Rows(n).Hidden = False Then
TempArray1 = Split(Loc1, Chr(10))
[COLOR="#FF0000"][B]If TempArray1(1).Value = "Je hebt een of meer ruimtes geboekt via Web Room Booking." Then[/B][/COLOR]
ActiveSheet.Cells(n, 10).Value = Right(TempArray1(15), Len(TempArray1(15)) - InStr(TempArray1(15), ":") - 1)
ActiveSheet.Cells(n, 11).Value = CDate(Right(TempArray1(9), Len(TempArray1(9)) - InStr(TempArray1(9), ",") - 1))
ActiveSheet.Cells(n, 12).Value = Right(TempArray1(10), Len(TempArray1(10)) - InStr(TempArray1(10), ":") - 1)
Else
ActiveSheet.Cells(n, 10).Value = Right(TempArray1(17), Len(TempArray1(17)) - InStr(TempArray1(17), ":") - 1)
ActiveSheet.Cells(n, 11).Value = CDate(Right(TempArray1(11), Len(TempArray1(11)) - InStr(TempArray1(11), ",") - 1))
ActiveSheet.Cells(n, 12).Value = Right(TempArray1(12), Len(TempArray1(12)) - InStr(TempArray1(12), ":") - 1)
End If
End If
Next n
End Sub