| 
    
     |  | こんにちは。かみちゃん です。 
 >ユーザー定義関数でA,B,C,Dの変数に収めてある数値を、大きい順に A & B & C & D と言う風に出力する定義関数を作りたい
 
 以下のような感じのことがしたいのでしょうか?
 
 定義関数の名前がいいのが思いつきませんでしたので、func1という名前にしています(^^;
 
 Sub Sample()
 Dim intA As Integer
 Dim intB As Integer
 Dim intC As Integer
 Dim intD As Integer
 
 intA = 4
 intB = 3
 intC = 2
 intD = 1
 
 MsgBox func1(Array(intA, intB, intC, intD))
 
 End Sub
 
 Function func1(vntData As Variant) As String
 Dim i As Integer
 Dim strData As String
 
 For i = 1 To UBound(vntData) + 1
 If strData <> "" Then
 strData = strData & "&"
 End If
 strData = strData & Application.WorksheetFunction.Large(vntData, i)
 Next
 
 func1 = strData
 End Function
 
 |  |