Wednesday 15 August 2012

excel - Copy values only to new workbook from multiple worksheets -


Assume that I have a workbook1.xlsm full of many worksheets and different sources. I would like to create a new workbook2.xlsx in the form of actually in the form of workbook1 but in all the chambers will have values ​​rather than sources.

As in form = Workbooks.Add Application.DisplayAlerts = False ThisWorkbook.Worksheets ("Przestoje") Cells.Copy Selection.Paste Special Paste:. = XlPasteValues, _Operation: = xlNone, SkipBlanks: = True, moved: = false Selection.Paste Special Paste: = xlPasteFormatsFilename = this workbook. Path & amp; "\" & Amp; "Worksheet2.xlsx" Output.SaveAs File Name End Sub

But the problem is that these copies are only a worksheet and this name does not tell that it was in worksheet1 . I can not understand it

Still another problem is that worksheet 2 is being opened later I do not want to do this.

How can I solve these problems?

I will do this as possibly as possible, without creating a new workbook and copying the sheet.

A few simple steps: Keeping this workbook in mind & gt; & Gt; For each worksheet within this workbook & gt; & Gt; The copy of the category used within the worksheet + Paste value & gt; & Gt; Save as Xlsx type as a new workbook & gt; & Gt; Open the base workbook & gt; & Gt; And in the end nearly made by us one of the

the code will be simplified and looks like this:.

DisplayLetts = for every S.H. output Fire DHH as a worksheet for the fire. Worksheet sh Usage Range CoP SU AUGEND RANGE. Paste Special xlPasteValues, _Operation: = xlNone, SkipBlanks: = True, Transpose: = False next filename = ThisWorkbook.Path & amp; "\" & Amp; "Worksheet2.xlsx" Output.SaveAs File Name, XlFileFormat.xlOpenXMLWorkbook Workbooks.Open Current Output.Close Application.DisplayAlerts = True End Sub

No comments:

Post a Comment