I need to copy rows between multiple worksheets and while I managed to do that it only copies the formulas and not the values. I haven't used VBA for years and I just can't think of how to do it.
My existing code is:
Workbooks.Open filename:=NewFN
filename = Mid(NewFN, InStrRev(NewFN, "\") + 1)
For i = 1 To 14
Workbooks(filename).Sheets("sheet1").Rows(i).Copy ThisWorkbook.Sheets("BD Raw Data").Rows(insertRow)
insertRow = insertRow + 1
Next i
Workbooks(filename).Close SaveChanges:=False
Try it
This sub copy all formulas in column C from sht1 to column C in sht2
[]´s
The choice between values and formulas is made in the paste half of the process. Have a look at the PasteSpecial method specifically the xlPasteValues argument.
http://msdn.microsoft.com/en-us/library/aa195818(v=office.11).aspx
You need to use the
PasteSpecial
method using theXlPasteType.xlPasteValues
enumeration instead ofCopy Destination
e.g.