【杂项】Set and let differences in VBA
Same:
set and let could both be used to set variables. Like:
set var1 = value
let var2 = value
Difference:
let is used to set nominal data types and could be omitted, as integer/string/double/variant. set is used to set object instead and could not be omitted , as excel.worksheet/range/workbooks..
Note:
Set is for the assignment of objects, a user defined type is treated like a regular variable so use = to assign.
浙公网安备 33010602011771号