abis itu masukin kode di bawah ini di view code
Dim data(1000) As Variant
Dim info As Boolean
Dim n As Integer
'bikin 3 variable dulu secara explicit
Private Sub Form_Load()
Text1.FontSize = 12
List1.FontSize = 12
List2.FontSize = 12
Command1.FontSize = 12
Command2.FontSize = 12
Label1.FontSize = 12
Label2.FontSize = 12
Label2.FontBold = True
info = False
End Sub
'command untuk inputan data
Private Sub Command1_Click()
x = 1
If Text1.Text = "" Then
MsgBox ("tidak ada jumlah yang di masukan mohon untuk si isi jumlah nya")
ElseIf IsNumeric(Text1) Then
n = Val(Text1)
Do While x <= Val(Text1)
data(x) = InputBox("masukan data " & x)
info = True
x = x + 1
Loop
Else
MsgBox ("jumlah harus numeric")
End If
End Sub
'command untuk proses memisah kan data di list1 dan list2
Private Sub Command2_Click()
List1.Clear
List2.Clear
Dim x As Integer
x = 1
If info = False Then
MsgBox ("data belum terisi")
Else
Do While x <= n
If IsNumeric(data(x)) Then
List1.AddItem data(x)
Else
List2.AddItem data(x)
End If
x = x + 1
Loop
End If
End Sub
dan hasil run nya kayak begini
atau kamu download saja project program yang udah jadinya
disini
Tidak ada komentar:
Posting Komentar