wrote :: 2003.10.08
Sub Sample()
Selection = "=RAND()"
End Sub
Sub Sample2()
Dim tmp As Variant
tmp = 100
MsgBox "変数内のデータは、" & TypeName(tmp) & " です。", 64
tmp = "tanaka"
MsgBox "変数内のデータは、" & TypeName(tmp) & " です。", 64
End Sub

Sub Sample3()
If TypeName(Selection) = "Range" Then
Selection = "=RAND()"
Else
MsgBox "セルを選択してから実行してください。", 16
End If
End Sub