Private Sub CommandButton1_Click()
With TextBox1
.SetFocus
.Text = .Text & "abc" & vbNewLine
lblPocetForm.Caption = "Form " & .LineCount - 1
End With
With Worksheets("Hárok1").Shapes("TextBox 2").OLEFormat.Object
.Text = .Text & "abc" & vbNewLine
lblPocetHarok.Caption = "Hárok " & Worksheets("Hárok1").Shapes("TextBox 2").TextFrame2.TextRange.Lines.Count
End With
End Sub
Volá sa to správne TextBox.
Tu máš pridávanie do oboch aj vo forme aj v hárku. Počet záznamo sa ukladá do 2 Label-ov:
lblPocetHarok
lblPocetFormcitovat
With TextBox1
.SetFocus
.Text = .Text & "abc" & vbNewLine
lblPocetForm.Caption = "Form " & .LineCount - 1
End With
With Worksheets("Hárok1").Shapes("TextBox 2").OLEFormat.Object
.Text = .Text & "abc" & vbNewLine
lblPocetHarok.Caption = "Hárok " & Worksheets("Hárok1").Shapes("TextBox 2").TextFrame2.TextRange.Lines.Count
End With
End Sub
Volá sa to správne TextBox.
Tu máš pridávanie do oboch aj vo forme aj v hárku. Počet záznamo sa ukladá do 2 Label-ov:
lblPocetHarok
lblPocetFormcitovat