Here is my simple code
Sub SavePrices()
'
' SavePrices saves spot prices from Sheet 'Spot' into Sheet 'saved prices'
'
Dim MyRangeS As String
MyRangeS = Sheets("saved prices").Range("I1").Value
Sheets("saved prices").Range(MyRangeS).Value = Sheets("Spot").Range("A2:C112").Value
End Sub
In cell I1 there is a VLOOKUP formula which gives a result A2:C113. When I run the code it gives 1004 Error. If I put A2:C113 i/o MyRangeS it works. While debugging MyRangeS equals to "A2:C113".
Have no idea what it can be.
Please advise.
P.S. The code is written in Module.