Question: what is the difference between function and sub in vba?
Answer: Function and Sub. The difference between a function and a sub in Excel VBA is that a function can return a value while a sub cannot. Functions and subs become very useful as program size increases.