Mache gerade meine ersten Gehversuche mit VBA-Basic.
habe ein "Userform" zur Dateneingabe vom Internet geladen und in meine Excel-Tabelle eingebunden. Es funktioniert einwandfrei, hat aber das Problem, dass ich nur TextStrings in die Zellen einfügen kann. D.h. wenn Zahlen gefordert sind wird die Zahl als "Text" in die Zelle eingetragen.
Wie kann ich das Problem lösen?
Hier der Code:
Private Sub CommandButton1_Click()
z = 20
Do While Cells(z, 1) <> ""
z = z + 1
Loop
Cells(z, 1) = Me.TextBox1
Cells(z, 2) = Me.TextBox2
Cells(z, 3) = Me.TextBox3
Cells(z, 4) = Me.TextBox4
Cells(z, 5) = Me.TextBox5
'Cells(z, 6) = Me.TextBox6
End Sub
Private Sub CommandButton2_Click()
ActiveWorkbook.SaveAs Filename:="Testdatei.xls"
ActiveWorkbook.Close
End Sub
Private Sub CommandButton3_Click()
we = Me.ScrollBar1.Value
Me.TextBox19 = we
Cells(we, 1) = Me.TextBox7
Cells(we, 2) = Me.TextBox8
Cells(we, 3) = Me.TextBox9
Cells(we, 4) = Me.TextBox10
Cells(we, 5) = Me.TextBox11
'Cells(we, 6) = Me.TextBox12
End Sub
Private Sub ScrollBar1_Change()
we = Me.ScrollBar1.Value
Me.TextBox19 = we
End Sub
Private Sub TextBox19_Change()
wee = Me.TextBox19
Me.TextBox7 = Cells(wee, 1)
Me.TextBox8 = Cells(wee, 2)
Me.TextBox9 = Cells(wee, 3)
Me.TextBox10 = Cells(wee, 4)
Me.TextBox11 = Cells(wee, 5)
'Me.TextBox12 = Cells(wee, 6)
End Sub
Private Sub UserForm_Click()
z = 20
Do While Cells(z, 1) <> ""
z = z + 1
Loop
Me.TextBox13 = Cells(z - 1, 1)
Me.TextBox14 = Cells(z - 1, 2)
Me.TextBox15 = Cells(z - 1, 3)
Me.TextBox16 = Cells(z - 1, 4)
Me.TextBox17 = Cells(z - 1, 5)
'Me.TextBox18 = Cells(z - 1, 6)
End Sub
Bitte um Hilfe.
joker