I am trying to copy a sheet to a new workbook with only values, not formulas. I need one column to retain formulas.
It may not be the best method, but I am trying to copy the formulas to a variant array, then copy the values, then add the array of formulas to the new worksheet.
I am using the following code but getting an error. "Run Time Error: 1004 Application defined or object defined error.
Set wbNew = Workbooks.Open(NewName)
Dim Colm As Variant
Dim Frange As Range
Colm = wbNew.Sheets(wsName).Range("F1:F100").Formula
wbNew.Sheets(wsName).UsedRange.Value = wbNew.Sheets(wsName).UsedRange.Value
Set Frange = wbNew.Sheets(wsName).Range("F1:F100")
Set Frange = Frange.Resize(UBound(Colm), 1)
Frange.Value = Colm
wsNameandNewName(but maybe that is just due to having posted something that isn't a MCVE?) (b) Which line gives the error? (c) Code worked for me once I gavewsNameandNewNamevalues, and gave different errors to the one you are getting if I hadn't.NewNameandwsNameare correct. This line does nothing:Set Frange = Frange.Resize(UBound(Colm), 1).Frangeis alreadyUBound(Colm)rows by 1 column.