So I have the index of some cells in my excel doc. I am now trying to use VBA to make a union between two different ranges.
So far I have...
Function FiveYTwoY()
 Worksheets("India Data").Activate
 index5_90 = Cells(10, "B").Value '5Y 90 day index
 index5_yes = Cells(9, "B").Value '5Y yesterday index
 index2_90 = Cells(7, "B").Value  '2Y 90 day index
 index2_yes = Cells(6, "B").Value '2Y yesterday index
 range5_90 = "Q" & index5_90
 range5_yes = "Q" & index_yes
 range2_90 = "S" & index2_90
 range2_yes = "S" & index2_yes 
 fullRange5 = Range(range5_90, range5_yes)
 fullRange2 = Range(range2_90, range2_yes)
 FiveYTwoY = Union(fullRange2, fullRange5)
however this isn't working and after debugging... its because my range is not setting properly. how do I fix this? I keep getting #value. I want to print the joined ranges Thanks for the help!
 
    