AW: Kommentare zurückschreiben (Tricky)
08.07.2022 12:06:12
Danny
Ich habe es mal versucht aber irgendwie schreibt er den Kommentar nicht rein.
Sub Kommentarezurückspielen()
Dim Blatt As String
Dim Zelle As String
Dim ws As Worksheet
Dim a, n As Integer
Dim s, z As Integer
Dim zeile As Long
Dim blattname As String
Dim blattname2 As String
s = 1
z = 2
For i = 2 To 10
'LR = ws.Cells(Tb.Rows.Count, 1).End(xlUp).Row 'letzte Zeile der Spalte
Debug.Print i
blattname = Worksheets("Kommentare").Cells(i, s).Value
Debug.Print blattname
blattname2 = Right(blattname, 2)
Debug.Print blattname2
Select Case blattname2
Case "DE": SP = 4
Case "EN": SP = 5
Case "FR": SP = 6
Case "ES": SP = 7
Case "IT": SP = 8
Case "PT": SP = 9
End Select
Debug.Print SP
Debug.Print i
Zelle = Worksheets("Kommentare").Cells(i, 2).Value
Üb = Worksheets("Kommentare").Cells(i, SP).Value
With Sheets(blattname).Range(Zelle)
.Comment.Shape.TextFrame.Characters(Start:=1, Length:=Len(Autor) + 1).Font.FontStyle = "Fett"
.Comment.Shape.TextFrame.Characters(Start:=Len(Autor) + 2, Length:=Len(Üb) + 2).Font.FontStyle = "Standard"
End With
Next
'Arbeitsmappe aus Spalte A auswählen und Activ seten
'Text aus Spalte D in position von C reinschreiben
'nächste Zeile aus Arbeitsblatt Kommentar
End Sub
Sub Kommentare_zurück()
Dim Tb As Worksheet, LR As Integer, i As Integer, Z1 As Integer, SP As Integer
Dim Sprache As String, Blatt As String, Zelle As String, Autor As String, Üb As String
Set Tb = Sheets("Kommentare")
Z1 = 2 'Erste Datenzeile
Sprache = InputBox("Welche Sprache soll verwendet werden?" & vbLf & vbLf & _
"D, EN, FR, ES, IT, PT", , "EN")
Select Case Sprache
Case "D": SP = 4
Case "EN": SP = 5
Case "FR": SP = 6
Case "ES": SP = 7
Case "IT": SP = 8
Case "PT": SP = 9
Case Else
MsgBox "Fehler Eingabe"
Exit Sub
End Select
LR = Tb.Cells(Tb.Rows.Count, SP).End(xlUp).Row 'letzte Zeile der Spalte
For i = Z1 To LR
Blatt = Tb.Cells(i, 1)
Zelle = Tb.Cells(i, 2)
Üb = Tb.Cells(i, SP)
With Sheets(Blatt).Range(Zelle)
.Comment.Shape.TextFrame.Characters(Start:=1, Length:=Len(Autor) + 1).Font.FontStyle = "Fett"
.Comment.Shape.TextFrame.Characters(Start:=Len(Autor) + 2, Length:=Len(Üb) + 2).Font.FontStyle = "Standard"
End With
Next
End Sub