JoelTXCive
Civil/Environmental
- Jul 24, 2016
- 929
I am writing an Excel VBA code that will collect information from the spreadsheet and then manipulate it.
I have several single-cell named ranges that I want to bring into the VBA code.
My question is:
Is it better/easier to declare variables in the VBA code and populate them with the named range values? Or is it better to continually just refer to the named range in the code?
For example, is it better to do something like this:
dim fc_prime as long
fc_prime = Range("fc_prime")
Or is it better to just continuously write Range("fc_prime") throughout the code as I perform calculations?
I would like the code to be as 'readable' as possible, so when I refer back to it after several months I can figure out what I was doing.
Thank you.
I have several single-cell named ranges that I want to bring into the VBA code.
My question is:
Is it better/easier to declare variables in the VBA code and populate them with the named range values? Or is it better to continually just refer to the named range in the code?
For example, is it better to do something like this:
dim fc_prime as long
fc_prime = Range("fc_prime")
Or is it better to just continuously write Range("fc_prime") throughout the code as I perform calculations?
I would like the code to be as 'readable' as possible, so when I refer back to it after several months I can figure out what I was doing.
Thank you.