I have VBA code that copies data from one WB to another, but for some reason the .PasteSpecial xl:= PasteValues doesn't work. I paste the formulas and all.
I tried
But that didn't work either
VBA Code:
Sub trial()
Dim wb As Workbook
Dim sheet As Worksheet
Set sheet = ThisWorkbook.Sheets("FLEX")
sheet.Activate
ThisWorkbook.Worksheets("FLEX").Range("B5:K20").Select
Selection.Copy
Set wb = Workbooks.Open("C:\NewBook.xlsx")
wb.Worksheets("Time").Activate
lastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
ActiveSheet.Cells(lastRow + 1, 1).Select
ActiveSheet.PasteSpecial xl = PasteValues
ActiveWorkbook.Save
'ActiveWorkbook.Close savechanges = True
Set wb = Nothing
ThisWorkbook.Worksheets("FLEX").Activate
'ThisWorkbook.Worksheets("FLEX").Cells ("Time")
Application.CutCopyMode = False
End Sub
I tried
VBA Code:
ActiveSheet.PasteSpecial xl = PasteValues Paste:=PasteValues