|
Sub pr()
Dim s, s1, s2, s3, s4, s5, s6, s7, s8 As String
s = InputBox("Введите строку")
s1 = Right(s, 8)
s2 = Left(s, 7)
s3 = Mid(s, 10, 1)
s4 = s2 & s3
s5 = Mid(s, 4, 1)
s6 = Mid(s, 6, 2)
s7 = Mid(s, 10, 2)
s8 = s5 & s6 & s7
MsgBox s1 & Chr(13) & _
s4 & Chr(13) & _
S8
End Sub
Sub pr()
Dim s, s1, s2, s3, s4, s5, s6, s7, s8 As String
Dim n, i, n1 As Integer
s = InputBox("Введите строку")
s1 = InputBox("Введите символ")
n = 0
n1 = Len(s)
For i = 1 To n1 Step 1
s2 = Mid(s, i, 1)
If s2 = s1 Then
n = n + 1
End If
Next i
MsgBox n
End Sub
Sub pr()
Dim str, str1 As String
Dim n, n1, n2 As Integer
Open "C:\1.txt" For Input As #1
Input #1, str
Close #1
n = Val(str)
Open "C:\2.txt" For Input As #2
Input #2, str1
Close #2
n1 = Val(str1)
n2 = n1 + n
Open "C:\3.txt" For Output As #3
Write #3, n2
Close #3
End Sub
код для кнопки Вычислить
Private Sub CommandButton1_Click()
Dim a, b, c, s As Single
a = CSng(UserForm1.TextBox1)
b = CSng(UserForm1.TextBox2)
c = CSng(UserForm1.TextBox3)
s = a + b + c
UserForm1.TextBox4 = s
End Sub
код для кнопки отмена
Private Sub CommandButton2_Click()
UserForm1.Hide
Дата добавления: 2015-08-18; просмотров: 63 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
Dim i, n As Integer | | | End Sub |