Forum Discussion
Have a calling sub macro call a sub macro ByRef passing variables back and forth
Hi Snowman55. I have printed out your corrections & suggestions. Thank you.
If I create a new sub macro called AccountDesc with nothing in it, & edit it in my macro list it looks like this:
Sub AccountDesc()
‘ Comment: This is called subroutine
End Sub
I can exit out of it and the name stays in my macro list & I can edit it again adding code and execute it by running it from my macro list.
If I edit the called macro and insert ByRef or ByVal variables and exit out of it the macro disappears from my macro list and I can't find it or re-edit it so it's lost.
Sub AccountDesc(ByVal Accountnumber As Integer, ByRef Accountinfo As String)
‘ Comment: This is called subroutine #1
End Sub
After inserting a ByVal and/or a ByRef variable, the macro disappears once I get out of it. Does anyone know how I can have my macro stay in my list and display it's name so I can re-edit it and execute run it? Thank you for any help.
- TommeeJun 21, 2023Copper ContributorHi Hans,
I found it within Developer under Object Browser.
Thank you so much!- SnowMan55Jun 22, 2023Bronze ContributorNote that you can also get to the procedure code quickly by right-clicking its name in calling code, and selecting "Definition" from the popup (context) menu. This also works for variable names, and for the property names and method names of most objects (if they are built-in objects, it shows them in the Object Browser).