ich habe eine Exceltabelle mit einem Zellbereich (A2:AC200). In diesem Zellbereich werden Zahlen per Makro von einer Eingabemaske eingefügt.
Leider kommen die Zahlen in Textformat und werden sie nicht bei der Berechnung/Formeln erkannt. Daher werden alle Berechnungen falsch gemacht.
Wie kann man per VBA die Zahlen in Text, die sich in Zellbereich (A2:AC200) befinden, in Text umwandeln?
Private Sub CommandButton2_Click()
Dim xZeile As Long
ActiveSheet.Unprotect
If TextBox1 = "" Then Exit Sub
If ComboBox1.ListIndex = 0 Then
xZeile = [B2000].End(xlUp).Row + 1
Else
xZeile = ComboBox1.ListIndex + 1
End If
Cells(xZeile, 2) = TextBox1
Cells(xZeile, 3) = TextBox2
Cells(xZeile, 7) = TextBox4
Cells(xZeile, 9) = TextBox6
Cells(xZeile, 11) = TextBox8
Cells(xZeile, 13) = TextBox10
Cells(xZeile, 15) = TextBox12
Cells(xZeile, 17) = TextBox14
Cells(xZeile, 19) = TextBox16
Cells(xZeile, 21) = TextBox18
Cells(xZeile, 23) = TextBox20
Cells(xZeile, 25) = TextBox22
Cells(xZeile, 27) = TextBox24
Cells(xZeile, 29) = TextBox26
TextBox1 = ""
TextBox2 = ""
TextBox4 = ""
TextBox6 = ""
TextBox8 = ""
TextBox10 = ""
TextBox12 = ""
TextBox14 = ""
TextBox16 = ""
TextBox18 = ""
TextBox20 = ""
TextBox22 = ""
TextBox24 = ""
TextBox26 = ""
UserForm_Initialize
End Sub
Code der MAkro ist so...was kann man machen, damit diese Zahlen als Zahlformat und nicht als Textformat eingefügt werden?Vielen Dank für eure Hilfe!
Danke schön
Ro