Thanks for the suggestions, but I'm still having a problem.
I'm trying to copy the cell values of one worksheet to another.
When I use this code (that I found in a forum), with all literals, it works fine:
Mydata = "='C:\jeff\temp\[StreetSmart.xls]StreetSmart'!$A$1:$P$54"
With ThisWorkbook.Worksheets("StreetSmart").Range("A1:P54")
'Load Formulas into old price spreadsheet in the main workbook
.Formula = Mydata
'Convert formulas to values
.Value = .Value
End With
But when I use a variable in place of 54 with this code:
Mydata = "='C:\jeff\temp\[StreetSmart.xls]StreetSmart'!$A$1:$P$" & PriceRow & """"
'With ThisWorkbook.Worksheets("StreetSmart").Range("A1:P" & PriceRow)
'Load Formulas into old price spreadsheet in the main workbook
.Formula = Mydata
'Convert formulas to values
.Value = .Value
End With
I get the following message at the .Formula = Mydata line:
Run Time Error 1004
Application-defined or Object-defined error.