Hi All,
I haven't needed to post here for quite some time but I'm stuck again.
Basically I have a selection Ranges stored as Variables, in the example below I've simplified it to just 2, Bob and Bill. I would like to glue the 2 Ranges together based on some other input (there are 9 in total, sometimes I will want to use all 9 ranges, other times just 1, and sometimes a random selection somewhere in between) Once I get the correct selection of ranges I can use them to make a graph update.
Example: Bob & Bill makes Bobill!
Unfortunately gluing them together using '&' did not work and I can't think what the syntax should be to make this work, I've tried searching google and these forums but I don't think I'm looking for the right thing any help would be appreciated.
I haven't needed to post here for quite some time but I'm stuck again.
Basically I have a selection Ranges stored as Variables, in the example below I've simplified it to just 2, Bob and Bill. I would like to glue the 2 Ranges together based on some other input (there are 9 in total, sometimes I will want to use all 9 ranges, other times just 1, and sometimes a random selection somewhere in between) Once I get the correct selection of ranges I can use them to make a graph update.
Example: Bob & Bill makes Bobill!
Code:
Sub RangeTest()
Dim bob As Range
Dim bill As Range
Dim bobill As Object 'tried this one
Dim bobill As Range 'and this one, same error
Set bob = ActiveWorkbook.ActiveSheet.Range("A1")
Set bill = ActiveWorkbook.ActiveSheet.Range("B2")
bobill = bob & bill 'tried this one
Set bobill = bob & bill 'and this one, same error
End Sub
Unfortunately gluing them together using '&' did not work and I can't think what the syntax should be to make this work, I've tried searching google and these forums but I don't think I'm looking for the right thing any help would be appreciated.