VBA – osmi zadatak uradjen

Posted: oktobar 17, 2011 in Uncategorized
Oznake:, , ,

VBA – osmi zadatak uradjen

Sub VeciOd8()
Dim br As Integer, I As Integer, J As Integer
br = 0
Set Opseg = Worksheets(„Sheet1“).Range(„M1:N4“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If IsNumeric(Opseg.Cells(I, J)) And Opseg.Cells(I, J).Value > 8 Then
br = br + 1
End If
Next
Next
If br = 0 Then
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If InStr(Opseg.Cells(I, J).Value, „Rade“) Then
Opseg.Cells(I, J).Font.Size = 14
Opseg.Cells(I, J).Font.Name = „Verdana“
End If
Next
Next
End If
MsgBox br
End Sub

Sub ParniVeciOd10()
Dim br As Integer, I As Integer, J As Integer, K As Integer
br = 0
K = Worksheets.Count
Set Opseg = Worksheets(K).Range(„A1:B4“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If IsNumeric(Opseg.Cells(I, J)) And Opseg.Cells(I, J).Value Mod 2 = 0 And Opseg.Cells(I, J).Value > 10 Then
br = br + 1
End If
Next
Next
If br = 0 Then
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If InStr(Opseg.Cells(I, J).Value, „Ana“) = 0 Then
Opseg.Cells(I, J).Font.Size = 13
Opseg.Cells(I, J).Font.Name = „Tahoma“
End If
Next
Next
End If
MsgBox br
End Sub

Sub Djeljiv5()
Dim br As Integer, I As Integer, J As Integer
br = 0
Set Opseg = Worksheets(„Sheet1“).Range(„A1:B4“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If IsNumeric(Opseg.Cells(I, J)) And Opseg.Cells(I, J).Value Mod 5 = 0 Then
br = br + 1
End If
Next
Next
If br = 0 Then
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If InStr(Opseg.Cells(I, J).Value, „52“) = 0 Then
Opseg.Cells(I, J).Font.Size = Opseg.Cells(I, J).Font.Size + 2
End If
Next
Next
End If
MsgBox br
End Sub

Sub Spec()
Dim br As Integer, I As Integer, J As Integer
br = 0
Set Opseg = Worksheets(„Sheet1“).Range(„A1:F5“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If Opseg.Cells(I, J) = „&“ Then
br = br + 1
End If
Next
Next
If br = 0 Then
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
ActiveSheet.Range(„C1:C10“).Font.Name = „Carier New“
ActiveSheet.Range(„C1:C10“).Font.Size = 11
ActiveSheet.Range(„C1:C10“).Font.Bold = True
Next
Next
End If
MsgBox br
End Sub

Sub Spec1()
Dim br As Integer, I As Integer, J As Integer
br = 0
Set Opseg = Worksheets(„Sheet1“).Range(„D2:E3“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
If Len(Opseg.Cells(I, J)) < 10 Then
br = br + 1
End If
Next
Next
If br = 0 Then
Set Opseg = Worksheets(„Sheet1“).Range(„A1:C10“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
Opseg.Cells(I, J).Font.Name = „Times New Roman“
Opseg.Cells(I, J).Font.Size = 12
Opseg.Cells(I, J).Font.Italic = True
Next
Next

End If
MsgBox br
End Sub

Sub Spec1()
Dim br As Integer, I As Integer, J As Integer
br = 0
Set Opseg = Worksheets(„Sheet1“).Range(„D2:E3“)
For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
S = Opseg.Cells(I, J).Value
If Mid(S, 1, 1) Like „[A-Z]“ Then
br = br + 1
End If
Next
Next
If br = 0 Then

For I = 1 To Opseg.Rows.Count
For J = 1 To Opseg.Columns.Count
Opseg.Cells(I, J).Font.Color = RGB(12, 21, 100)

Next
Next

End If
MsgBox br
End Sub

Advertisements

Zatvoreno za komentare.