'LISTING 1.1
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As _
Integer, ByVal x As Single, ByVal y As Single)
' Deklarujemy zmienną określającą ilość przebiegów pętli For_next oraz
' numer wiersza komórki
Dim a As Byte
' Pętla For ... next jest wykonywana 63 razy; tyle mamy komórek, w których
' mogą być wpisane oceny
For a = 1 To 63
' Sprawdzane są wszystkie niepuste komórki (Cells(a,1).Value <>" ").
If Cells(a, 1).Value <> "" And Cells(a, 1).Value <> 1 _
And Cells(a, 1).Value <> "1+" _
And Cells(a, 1).Value <> "2-" And Cells(a, 1).Value <> 2 _
And Cells(a, 1).Value <> "2+" _
And Cells(a, 1).Value <> "3-" And Cells(a, 1).Value <> 3 _
And Cells(a, 1).Value <> "3+" And Cells(a, 1).Value <> "4-" _
And Cells(a, 1).Value <> 4 And Cells(a, 1).Value <> "4+" _
And Cells(a, 1).Value <> "5-" And Cells(a, 1).Value <> 5 _
And Cells(a, 1).Value <> "5+" And Cells(a, 1).Value <> "6-" _
And Cells(a, 1).Value <> 6 Then
'Wyświetlone zostanie okno informacyjne
MsgBox "Wprowadzona ocena jest błędna !."
End If
Next
End Sub
'LISTING 1.2
Private Sub P1_AfterUpdate()
If Range("A1").Value <> "" And Range("A1").Value <> 1 _
And Range("A1").Value <> "1+" And Range("A1").Value <> "2-" _
And Range("A1").Value <> 2 And Range("A1").Value <> "2+" _
And Range("A1").Value <> "3-" And Range("A1").Value <> 3 _
And Range("A1").Value <> "3+" And Range("A1").Value <> "4-" _
And Range("A1").Value <> 4 And Range("A1").Value <> "4+" _
And Range("A1").Value <> "5-" And Range("A1").Value <> 5 _
And Range("A1").Value <> "5+" And Range("A1").Value <> "6-" _
And Range("A1").Value <> "6" Then
MsgBox "Wprowadzona ocena jest błędna !"
Range("A1").Value = ""
End If
End Sub
'LISTING 1.3
Private Sub UserForm_Activate()
Ps1.Value = Range("U1").Value
Ps2.Value = Range("U2").Value
Ps3.Value = Range("U3").Value
Ps4.Value = Range("U4").Value
Ps5.Value = Range("U5").Value
Ps6.Value = Range("U6").Value
Ps7.Value = Range("U7").Value
Ps8.Value = Range("U8").Value
Ps9.Value = Range("U9").Value
Ps10.Value = Range("U10").Value
End Sub
'LISTING 1.4
Private Sub CommandButton1_Click()
Średnie.Hide
End Sub
'LISTING 1.5
Private Sub CommandButton1_Click()
Średnie.Show
End Sub
'LISTING 1.6
Private Sub CommandButton2_Click()
Średnie.Hide
End Sub
'LISTING 1.7
Private Sub CommandButton3_Click()
Application.Quit
End Sub
'LISTING 1.8
Sub Auto_open()
Oceny.Show
End Sub
'LISTING 1.9
Sub Auto_open()
Sheets(1).Visible = True
Sheets(1).Select
Oceny.Show
End Sub
'LISTING 1.10
Private Sub CommandButton2_Click()
Oceny.Hide
Sheets(1).Visible = False
End Sub
Private Sub CommandButton3_Click()
Sheets(1).Visible = False
Application.Quit
End Sub
Private Sub UserForm_Activate()
Sheets(1).Visible = True
Sheets(1).Activate
End Sub
Wyszukiwarka
Podobne podstrony:
rozdz11 3Rozdz12fotogrametria rozdz1ROZDZ12rozdz19 (2)Rozdz13Anteny terminalowe rozdz1 i 2rozdz12 (2)rozdz1ROZDZ1ROZDZ1Rozdz11ROZDZ10A (2)więcej podobnych podstron