Hi:
I am having some trouble with assigning named workbook ranges to variables in VBA.
I have done the following:
1. Declared the VBA variables as Range variables
2. Used the Set function to load the variable content
Example:
Declare variable type
[/pre]
The error that I receive is a Type Mismatch (run-time error 13)
I have tried various things including changing the variable type to string, but that simply moves the problem rather than solve it. So all the variables load except rng_HistMin.
If someone provide guidelines, that would be great, thank you.
Regards,
Michael
I am having some trouble with assigning named workbook ranges to variables in VBA.
I have done the following:
1. Declared the VBA variables as Range variables
2. Used the Set function to load the variable content
Example:
Declare variable type
Code:
Dim rng_Lastdate, rng_HistMax, rng_HistMed, rng_HistMin As Range
Code to load variable content:
[pre]Set rng_Lastdate = ActiveWorkbook.Names("rng_US_LastDate")
Set rng_HistMin = ActiveWorkbook.Names("rng_US_HistMin")
Set rng_HistMed = ActiveWorkbook.Names("rng_US_HistMed")
Set rng_HistMax = ActiveWorkbook.Names("rng_US_HistMax")
The error that I receive is a Type Mismatch (run-time error 13)
I have tried various things including changing the variable type to string, but that simply moves the problem rather than solve it. So all the variables load except rng_HistMin.
If someone provide guidelines, that would be great, thank you.
Regards,
Michael