Live-Forum - Die aktuellen Beiträge
Datum
Titel
17.10.2025 10:28:49
16.10.2025 17:40:39
Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Kommentare

Forumthread: Kommentare

Kommentare
25.07.2006 12:25:19
otto
Hallo,
folgender Code ist auf einer Schaltfläche in einer UF hinterlegt.
Wenn in der Zelle (az+1,50) noch kein Kommentar ist funktioniert alles, wenn aber schon einer drin ist kommt ein Fehler - Wieso?

Private Sub OK_Click()
az = ActiveCell.Row
Dim text
text = TextBox1.text
On Error GoTo Kommentar
Cells(az + 1, 50).AddComment text
Exit Sub
Kommentar:
Cells(az + 1, 50).Comment.text = text
Unload Me
End Sub

Hier noch Initialize:

Private Sub UserForm_Initialize()
On Error GoTo überspringen
Dim text As Variant
az = ActiveCell.Row
text = Cells(az + 1, 50).Comment.text
TextBox1 = text
überspringen:
End Sub

Gruß otto
Anzeige

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
AW: Kommentare
25.07.2006 12:38:56
Hoffi
Hallo,
vielleicht so:

Private Sub OK_Click()
az = ActiveCell.Row
Dim text
text = TextBox1.text
If Cells(az + 1, 50).comment = "" then
Cells(az +1, 50).AddComment text
Else
Cells(az + 1, 50).Comment.text = text
End if
End Sub

Grüße Hoffi
P.S. Rückmeldung wäre nett...
Anzeige
AW: Kommentare
25.07.2006 12:40:22
Matthias
Hallo Otto,
lösche den evtl. vorhandenen Kommentar doch vorher einfach:

Private Sub OK_Click()
az = ActiveCell.Row
Dim text
text = TextBox1.text
With Cells(az + 1, 50)
.ClearComments
.AddComment text
End With
Unload Me
End Sub

Gruß Matthias
Anzeige
Danke
25.07.2006 13:10:18
otto
Hi,
besten Dankl, war wohl zu einfach.
otto
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Entdecke mehr
Finde genau, was du suchst

Die erweiterte Suchfunktion hilft dir, gezielt die besten Antworten zu finden

Suche nach den besten Antworten
Unsere beliebtesten Threads

Entdecke unsere meistgeklickten Beiträge in der Google Suche

Top 100 Threads jetzt ansehen
Anzeige