22-02-19, 19:49
|
| Συντονιστής Όνομα: Σπύρος Τσιλιγιάννης Έκδοση λογισμικού Office: Ms-Office 2003, Ms-Office 2007, Ms-Office 2010, Ms-Office 2013, Ms-Office 2016, Ms-Office 365 Γλώσσα λογισμικού Office: Ελληνική, Αγγλική | | Εγγραφή: 22-11-2011 Περιοχή: Αθήνα
Μηνύματα: 2.402
| |
Δείτε και μια ακόμα λύση, στο Change του TextBox. Κώδικας: Option Explicit
Const Rlimit As Byte = 5 'Καταχωρήστε το όριο γραμμών, ΕΔΩ
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub UserForm_Initialize()
With Me.TextBox1
.MultiLine = True
.ScrollBars = fmScrollBarsVertical
.EnterKeyBehavior = True
End With
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub TextBox1_Change()
Dim temp As String
With Me.TextBox1
If .CurLine > Rlimit - 1 Then
MsgBox "Δεν Επιτρέπονται, Περισσότερες Από: " & Rlimit & " Γραμμές."
temp = .Text
If Right(temp, 2) = vbCrLf Then
temp = Left(temp, Len(temp) - 2)
Else
temp = Left(temp, Len(temp) - 1)
End If
.Text = temp
End If
'Προαιρετικά
.Value = Application.WorksheetFunction.Proper(TextBox1.Value)
End With
End Sub Η τελευταία γραμμή ('Προαιρετικά)
εμφανίζει το κείμενο με πρώτο γραμμα κάθε λέξης κεφαλαίο. |