View Single Post
 
Old 02-29-2020, 12:18 AM
Jennifer Murphy's Avatar
Jennifer Murphy Jennifer Murphy is offline Windows XP Office 2007
Competent Performer
 
Join Date: Aug 2011
Location: Silicon Valley
Posts: 234
Jennifer Murphy is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Any variables you declare at the top of your code module (i.e. before any subs) will be available to all subs in that code module. See, for example: https://www.msofficeforums.com/148491-post2.html
That's what I surmised.

After playing with that a bit, I decided to pass the variables I want the Sub to change with ByRef and the rest with ByVal. It's working now and I think it's more readable code. All of my declarations are together in the main Sub and it's clear what the sub Sub is working with.

Thanks.
Reply With Quote