Hello,
I am trying to write a custom function. The function takes two arguments, state & HazardGroup. Depending on which state is used, the range will be based on a different worksheet. I would like to be able to use the state arg to choose the worksheet, but I haven't been able to get it to work. Here is the code I am trying:
Dim FirstRange As Range
Set FirstRange = ActiveWorkbook.Sheets(State).Range("a7:a47"
Any thoughts on this?
thanks
Mandy
I am trying to write a custom function. The function takes two arguments, state & HazardGroup. Depending on which state is used, the range will be based on a different worksheet. I would like to be able to use the state arg to choose the worksheet, but I haven't been able to get it to work. Here is the code I am trying:
Dim FirstRange As Range
Set FirstRange = ActiveWorkbook.Sheets(State).Range("a7:a47"
Any thoughts on this?
thanks
Mandy