excel vba - Copy All values VBA script failing -


I am trying to create a VBA script that copies all the data in the entire workbook, just like the chip , Then a new one. Workbook, thus removing all the sources

Here is my code:

sub makeAllVals () worksheet in each wSheet wSheet .UsedRange.Copy. With PasteSpecial for retarded XlValues ​​as wSheet worksheet Next wSheet Application.Dialogs (xlDialogSaveAs). Ended with Show End Sub

I have a runtime error 1004 on the PasteSpecial xlValues ​​command, But why can not I work?

How can I complete the goal of pasting and saving all data as a new workbook?

You have to paste a threshold in the new sheet. Currently you are not pasting it within the new book and you are not pasting it within a range.

Make the Import in the oldBook. Sheets' Loop through each sheet for each oldSheet. ThisWorkbook's formula worksbook sets you want to copy from the newBook ​​= Workbooks. Add set 'NewSheet = Newbook.Sheets.Add' newSheet.Name's To add values ​​to a new book Create new sheets. Name = old sheet Name & amp; "Value" oldSheet.UsedRange.Copy newSheet.Range ("A1"). Show Save as dialogue window End Sub
< / Html>

Comments