This is kind of silly, but I\'ve been stuck for a while in this simple statement:
Dim range1 as Range Dim mysheet as String Dim myrange as String
You need to use Set to assign objects:
Set range1 = Worksheets(mysheet).Range(myrange)