Option Explicit
Sub test()
MsgBox CopieCasse("oui", "Yes")
End Sub
Function CopieCasse(ByVal Cbl As String, ByVal Src As String) As String
Dim P As Long, Maj As Boolean, C As String * 1
For P = 1 To Len(Cbl)
If P <= Len(Src) Then Maj = Mid$(Src, P, 1) = UCase(Mid$(Src, P, 1))
C = Mid$(Cbl, P, 1)
If Maj Then CopieCasse = CopieCasse & UCase$(C) _
Else CopieCasse = CopieCasse & LCase$(C)
Next P
End Function