Using Set in VBA Compiler

Hello,
I’m trying to use the key word set in the vba compliler, is that possible?
There’s an error using this code, could you help me?

Function Test(Param1) as range
Dim x as range
Set x= application.range(“A1”).currentregion
Set Test = x
End Function

No, don’t use it. It is not necessary for variable assignment in our VBA compiler.