What's the difference between Trim() and Trim$() in VBA?

后端 未结 4 1946
眼角桃花
眼角桃花 2020-12-09 04:29

What is the difference between trim and trim$ in vba? Accidentally today when I used left and trim functions in vba, The compiler said cant f

4条回答
  •  庸人自扰
    2020-12-09 05:33

    trim accepts a variant as its parameter while trim$ accepts a string.

    There are some performance benefits for using trim$ (since you aren't converting from a variant), but chances are you wouldn't notice them.

    EDIT:

    I figured this out by checking the object browser. When you are in the VBA editor, press F2 and you can search for functions and be come more familiar with the framework.

提交回复
热议问题