vb对列表框中某行求和
vb对列表框中某行求和 能实现吗
Private Sub Command1_Click() For i = 1 To Len(Text1.Text) MsgBox Mid(Text1.Text, i, 1) 'MsgBox Right(Left(Text1.Text, i), 1) 'm = m + Right Right(Left(Text1.Text, i), 1) Next End Sub
Dim b(1 To 1, 1 To 6) As Integer Private Sub Command1_Click() '文本框中一行各列数相加 Text1 = "" Text2 = "" For i = 1 To 1 For j = 1 To 6 b(1, j) = Int(9 * Rnd) + 1 Text1.Text = Text1.Text & CStr(b(1, j)) & "" Next Next End Sub Private Sub Command2_Click() Dim s% Text2 = "" For j = 1 To 6 s = s + b(1, j) Next Text2 = s End Sub