VBA – sedmi zadatak

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

VBA – sedmi zadatak

1. test
Function NisuSlova(S As String) As String
Dim I As Integer, K As String
K = „“
For I = 1 To Len(S)
If Not Mid(S, I, 1) Like „[A-Za-z]“ Then
K = K & Mid(S, I, 1)
End If
Next
NisuSlova = K
End Function

2. test

Function NisuCifre(S As String) As String
Dim I As Integer
For I = 1 To Len(S)
If Not Mid(S, I, 1) Like „[0-9]“ Then
Mid(S, I, 1) = „*“
End If
Next
NisuCifre = S
End Function

3.test

Function MalaUDolar(S As String) As String
Dim I As Integer
For I = 1 To Len(S)
If Mid(S, I, 1) Like „[a-z]“ Then
Mid(S, I, 1) = „$“
End If
Next
MalaUDolar = S
End Function

4. test

Function NisuVelika(S As String) As Integer
Dim I As Integer, Br As Integer
Br = 0
For I = 1 To Len(S)
If Not Mid(S, I, 1) Like „[A-Z]“ Then
Br = Br + 1
End If
Next
NisuVelika = Br
End Function

5. test

Function CifSpec(S As String) As String
Dim I As Integer, S1 As String
S1 = „“
For I = 1 To Len(S)
If Mid(S, I, 1) Like „[0-6$%&]“ Then
S1 = S1 & Mid(S, I, 1)
End If
Next
CifSpec = S1
End Function

Advertisements

Zatvoreno za komentare.