stephenj789
Technical User
Although I am not new to Visual Basic, there are a few basics that I don't yet understand, specifically passing off variables (arguments) to other functions/subroutines. I wondered if someone could post some simple Excel VBA code that I could plunk into the vb editor, that would show me (I could change values, etc.) the following:
1.The difference between a sub and function.
2.The difference between ByVal and ByRef
3.The concept of passing an argument (variable) to another routine.
4.The difference between an argument or variable (if any).
I have tried creating the VBA code myself, but it always comes back with run time errors, hence my confusion on the subject. The sheet object I would like to be named 'Sheet1' and the workbook object to be 'book1'. Thanks for your help.
1.The difference between a sub and function.
2.The difference between ByVal and ByRef
3.The concept of passing an argument (variable) to another routine.
4.The difference between an argument or variable (if any).
I have tried creating the VBA code myself, but it always comes back with run time errors, hence my confusion on the subject. The sheet object I would like to be named 'Sheet1' and the workbook object to be 'book1'. Thanks for your help.