Copy Selected Worksheets As Values To New Workbook

Jun 22, 2008

I have a workbook with 30 some sheets. I would like to have a macro that if i select multiple sheets, will paste the values and formats of those sheets into a new workbook. I would like this to keep the names of the worksheets when transfered to the new workbook.

Thus far, I have been using this code, which does nearly everything i want, but instead of pasting the values, it gives me #VALUE! for nearly all the cells. Most of the cells are using Vlookup and/or Indirect functions to reference other sheets- not sure if this is relevant. The few cells that do paste accurately are either text or simply reference another cell on a different worksheet without a function.

Here's my code.


Sub PasteShtVal()
Dim w As Worksheet
ActiveWindow.SelectedSheets.Copy
For Each w In ActiveWorkbook.Sheets
With w.UsedRange
.Value = .Value
End With
Next w
End Sub

View 9 Replies


ADVERTISEMENT

Copy Worksheets To New Workbook And Convert To Values

Mar 19, 2007

I'm looking for a way that I could place a button on my workbook that would create a new document from the specified worksheets and convert the formulas to the values.

View 9 Replies View Related

Copy Data From Selected Worksheets Only?

Nov 6, 2013

I am trying to work out how to copy all data from worksheets that begin with the name 'Sheet' and paste that information onto the next available blank cell in a workbook called 'Results'. I have found how to copy information from all worksheets to 'Results' but not from selected worksheets that begin with the name 'Sheet'.

View 6 Replies View Related

Copy Selected/Chosen Worksheets Into 1

May 21, 2008

I am setting up a macro where the user opens their chosen file & their chosen worksheet which gets renamed & entered into my workbook. I can get them to open a workbook but I am having problems with the user being able to choose a worksheet and copy it over.

View 4 Replies View Related

Convert Selected Range On All Worksheets To Values

Aug 9, 2007

I have a macro that changes user selection from formulas to values:

Dim vCol As Variant

vCol = Application.InputBox("Select Column", Type:=2)
If vCol = False Or vCol = "" Then Exit Sub
Set UserRange = Range(vCol & "9:" & vCol & "35")
UserRange.Value = UserRange.Value

End Sub

I have several workbooks that use this macro, and the workbooks can include several sheets.

Is there's an easy way to change the macro so the user selection is changed in all sheets in the workbook. E.g. if the user selection is column H, the formula is changed to values in all sheets in the workbook.

View 4 Replies View Related

Copy Selected Sheets To New Workbook

Jan 25, 2009

I have a workbook with about 25 sheets. All the sheets are named. I'd like either a Macro or some VBA code whcih, when the user clicks a button will Unhide selected sheets, say "Equip Labor", "Equipment", Proj. Summary" and "Implementation Guide" and then copy these sheets into a new workbook created on the fly (Book1.xls) and then in the original workbook re-hide all the selected sheets. This way the user can save the new workbook as whatever name they want.
Is this possible? The closest post I could find was this:
http://www.mrexcel.com/forum/showthr...opy+Worksheets
I tried to modify this, but I'm not that good yet with VBA.

View 9 Replies View Related

Copy Selected Range To A New Workbook

Mar 30, 2009

I have a code that will allow me to copy three worksheets from an open workbook to a new workbook. That works great, but I only need only a selected range from each of these worksheets to be copied (Range A1:AV60). Here is the code I use to select and copy the worksheets, how do I add a range within this code for each worksheet.

Sheets(Array("Req Page 1", "Req Ext 1", "Req Ext 2")).Copy

View 9 Replies View Related

Copy Selected Range To New Workbook

Sep 13, 2007

I am trying to create a method to select the values of contiguous range selections on excel worksheets.

Users will be making new worksheets in new workbooks out of the data from the old sheets.

Currently users make a selection is and copy it to a new worksheet.

Is it possible to retrieve from the 'clipboard', the values from the associated cells?

And then to parse them into columns in a new worksheet?

Earlier I tried this bit of ( it didnt work )

Sub AddNew()
' for passing highlighted text into the form so that I can pass it
'to a new workbook.
Dim PassData1 As String
Selection.Value = PassData1
Set NewBook = Workbooks.Add
With NewBook
.Title = "xxx"
. SaveAs Filename:="xxx.xls"
End With
Range("A1").Value = PassData1
End Sub

View 9 Replies View Related

Copy Columns From One User Selected Workbook To Another

Apr 27, 2014

I am using this code to copy columns C,D, and P from a user selected workbook into position C,D,E of workbook "Checklist.xlsx" (the one from were I run the VBA code). I don't have a clue about VBA, just have been gathering info, but the code works pretty fine. The only issue is that it opens twice the workbook "wbExt" hence the system prompts me if i want to reopen the already open workbook.

Some questions:

1) Is there a way to copy the 3 columns at once? something like "Columns("C:D, P").Select".
2) Is there a way to select the workbook from were to copy the column without needing it to actually open?
3) is there a way to paste the columns starting from row 3 instead of row 1 (Range("C1").Select)?

View 2 Replies View Related

Copy Selected Data To Workbook On Desktop..

Oct 13, 2009

As the buyer edits orders, I have a macro which pulls out all the parts with changes and puts them on a sheet named "Changes" in the attached "Sample" workbook. Since the buyer will do dozens of these edits a day, I'm trying to create a simple way for them to create a list of parts they may want to try and buy from another source.

I would like to add a macro that would open a message box telling the buyer to select the parts they want to copy. They could select whatever rows they want to copy to the "Backorder List", and select "OK" or hit "Enter", and the macro would open the workbook named "Backorder List.xls" on their desktop, (mine is located under "C:Documents and Settingsjerry.hutchesonDesktop"), and copy the selected rows to the workbook, then save changes and close the "List" workbook. It should only paste the values, to preserve whatever formatting is in the book being copied TO, and it should copy below any data already in the workbook.

To make things even more difficult, the macro would also need to copy the Vendor # and PO # from the top of the "Sample" workbook, (cells B2 and B3 respectively), and enter that data beside the other data just pasted beside the parts data in the backorder list. (I have entered sample data in the backorder list to show what I mean.)

View 2 Replies View Related

Copy Current (Selected) Sheet To New Workbook And Save As Tab Name

Feb 28, 2014

I want to take the current sheet and copy to a new workbook (keeping the tab name) and then save as the tab name (xlsl) and close.

I've found ones that do a Saveas box or ends up saving as "Sheet1," "Sheet2" etc but can't seem to find one that keeps tab name and saves.

Here is the one I was using, but it saves all tabs not just selected:

Code:
Sub CopySheet()
Dim fname As Variant, ws As Worksheet, wb As Workbook
Dim nCol As Integer, iCol As Integer

[Code].....

View 1 Replies View Related

Copy Worksheets From Active Workbook To A New Workbook

Apr 22, 2009

I am trying to code a Macro so that i can take all the worsheets and save them as individual Workbooks. I wrote a macro that appeared to work, but, after it saves the first sheet as a workbook, i get a debug error.

MS VB Script error:
Runtime error '9':
Subscript out of range

Any advise would be greatly appreciated.

Thank you

Code is below..

Sub saveall()
'
'
For Each ws In ActiveWorkbook.Worksheets

ThisFN = "C:Documents and SettingsUserDesktop" & ws.Name & ".xls"
I = I + 1
Sheets(I).Select
Sheets(I).Move
ActiveWorkbook.SaveAs Filename:= _
ThisFN, FileFormat:=xlNormal, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

Next ws

End Sub

View 9 Replies View Related

Copy All Selected Sheets (data / Formats / NOT Formulas) To New Workbook

Oct 2, 2013

I had a macro on my previous laptop that worked, but didn't have the macro backed up so it was lost.

I need a vba macro that will copy all active/selected worksheets into a new workbook. Included requirements:

* Maintain tab names

* Only bring in contents/data with all formats (including logo image, but NOT formulas or hidden rows/columns)

* Keep the file name the same except adding "- FINAL" to the end

View 3 Replies View Related

Copy And Paste Selected Range Into Another Workbook Based On Headings And Next Empty Blank Row

May 14, 2014

I have a worksheet with some info that is filled in from other employees. I have Customer Name, Date of Oldest Invoice, Avg. Days Beyond terms in column N42:N44, with the data in column M42:44. I want to copy and paste that into another workbook, I need to transpose the data and then paste it into the next blank row. IF POSSIBLE, I would like to have some of the column headings the same as the above fields, and I would like to paste the data into the correct column heading.

Currently I have the code listed below. It copies the data, opens the spreadsheet, (this is where it fails) find the next blank row and transpose and paste the data. It does transpose and paste the data but it does not look for the next blank row, instead it just transposes and pastes the data in the last cell that was active when the work book was closed.

Code:

Private Sub CommandButton1_Click()' Paste Macro
' Macro recorded 5/14/14
'
'
Range("O42:O47").Select
Selection.Copy

Workbooks.Open Filename:="L:Financial Services! FRA !! Preston !3rd Party Collections Accounts 2014.xls"

[Code] ..........

View 8 Replies View Related

Copy Worksheets To New Workbook

May 21, 2008

I have a workbook containing several worksheets I want to copy to a workbook of their own and save under a specific name/password through a macro.

However, I have five difficulties:

1) I want to new workbook to contain only 1 worksheet. So, only the worksheet copied from the original workbook, and no other worksheets.

2) I want to be able to manually select the destination file for the copied workbook, however. This should be the same file for all workbooks.

3) I want the data copied from original worksheet to be ‘pasted as value’ only, so no formulas in the new workbook.

4) I want the new workbook to be read-only. Therefore I want the workbook to be /locked and password protected. So, the password should be only for altering cells, not for opening the workbook. See also point below.

5) Regarding the naming and passwording part I have made a matrix table in a worksheet named: “Rekeningen” (this worksheet is in the original workbook). This table contains three columns:

Column A, cells 40:65, contains the names of the worksheets I want to copy
Column B, cells 40:65, contains the names of the new workbooks
Column C, cells 40:65, contains the passwords of the new workbooks

So for example ....

View 9 Replies View Related

Copy All WorkSheets To Another Workbook

Sep 5, 2007

Assume 2 Workbooks - the Active one and "Book2".

I mannaged to copy ALL the sheets from the ActiveWorkBook to "Book2" with the following code - but as you can see the code copies each of them AFTER the last sheet in "Book2".

Sub Copy_Sheets()
' Copy All sheets from ActiveWorkbook to "Book2.xls"
For Each SH In ActiveWorkbook.Sheets
SH.Copy After:=Workbooks("Book2").Sheets(Workbooks("Book2").Sheets.Count)
Next
End Sub

How can I copy them to "BEFORE", lets say Sheet(1) in "Book2" ?

I tried to change the SH.Copy command to somthing that sounds logic to me, such as:

SH.Copy Before:=Workbooks("Book2.xls").Sheets(1)

but got the: "Run-time error '9' - Subscript out of range".

View 5 Replies View Related

Copy Active Worksheets Into One New Workbook

Jul 3, 2007

I have 16 proposals that are either hidden or visible in a proposal generator. I need to be able to copy only the visible worksheets over to a new workbook that uses a name from a cell inside the proposal generator. Then a save as prompt to force the user to save the file wherever they choose.

View 14 Replies View Related

Copy All Worksheets Into Master Workbook

Sep 19, 2009

Using a Command button into my Master file, I'm looking for a code that give me an option to select an existing file that will have a variable name & path, open it and then copy all worksheets contained within it, into my Master workbook. Then close the selected file on completion.

Not sure if it's important but some of the copied worksheet names will contain copies. e.g. Apples, Apples (2), Pears, Pears (2). etc.

View 9 Replies View Related

Copy Worksheets Into Current Workbook

Oct 30, 2006

I have developed a macro, run by a button click, in my workbook.

I have about 5 other workbooks to process, what I want to do is to have my workbook with my macro open, then either copy or import these other 5 workbooks, one at a time, into my current workbook so I can run my macro on their data. Not sure if I need to copy them in or not, but thats all I can think of. I'm not even sure how to do this manually, I tried having my workbook open and doing a file - import on the .xls file, but it seems to be translating my data and I'm ending up with a value of 'f1' in one of my columns, no idea what that is. All I really want to accomplish is to run my macro on each of the 5 workbooks, one at a time.

View 4 Replies View Related

VBA - Copying Multiple Worksheets Into New Workbook As Values

Dec 14, 2012

I am trying to optimize my code below. It works but it is soo slow, it seems to slow down on the array copy and paste special areas. I believe this is because its doing a cell to cell paste method. These sheets have data as well as graphs that i want to retain on the new sheet, but i could select ranges for each each if that would speed up this procedure.

Code:

Sub CreateDataSheet()
Dim ws As Worksheet
Dim sDataOutputName As String
With Application
.Cursor = xlWait
.StatusBar = "Saving DataSheet..."
.ScreenUpdating = False

[Code]....

View 9 Replies View Related

Copy All Worksheets In Lots Of Workbooks Into One Workbook?

May 8, 2013

All i need to do is copy all worksheets in lots of workbooks into one workbook with multiple sheets, easy right!!

View 2 Replies View Related

Copy Worksheets Of Chosen Files Into Workbook

Nov 27, 2007

I have different excel files in a specific folder. All the files have only two sheets with same kind of data, formatting etc. Now I want to merge selective files on need basis (only the first sheet data) into a new different worksheet in which I will be running the code. Provide me a macro which will ask me to select the files I want to merge. Also the data range of the files ( needs to be merged) will vary time to time, so the macro needs to take care of that as well.

View 2 Replies View Related

Copy Values From A Worksheet To Another Workbook. Source Workbook Name Unknown

Aug 12, 2009

I need to copy a range of values (actually two ranges). The ranges are of fixed size. Le't say A2:D20 and E2:H20.

Both workbooks have the exact same layout, and they both have the same named worksheet (in this case it's called Entry). However the actual filename of the source workbook is unknown. I know numerous users have changed the filename of the xls file.

I want to instruct them to open the old and new workbook, and open a third workbook containing the copy macro, they run the macro and it copies the data.

How can I reference a known worksheet name but of an unknown workbook name esp when the source and destination share the worksheet name?

View 3 Replies View Related

Highlight Duplicate Values On Multiple Worksheets In Same Workbook?

Aug 18, 2013

I have a workbook that has five worksheets listing warehouse inventory items. One worksheet for 2013, 2012, 2011, 2010 and 2009. In column b of each worksheet is a column B with a heading of "Item Number". There are hundreds of item numbers on each worksheet.

I would like to be able to find and highlight item numbers that appear in multiple years. Preferably color coded showing appears in five, four and three years. If that's too difficult than just items that appear in all five years. I tried conditional formatting, but have been unsuccessful.

Lastly, is there a way to list any duplicate item numbers on a new worksheet.

View 5 Replies View Related

Copy Data From All Worksheets One By One And Append In The Master Workbook

Jul 20, 2013

I have a report(Input report) with multiple sheets with different worksheet names.

Now I have to select 2nd worksheet of input report and copy a certain range values and paste in the other workbook(output) . From the same sheet 3 diffrent values I will copy and paste in other work book.

Now, I have to come back to the input report and go to next sheet and copy the same range data and append to the out put report below the first sheet.

This I need to do for all worksheets for the input report worksheets (there are more than 100 worksheets)

[code here]

VB:
Sub testtest()
'
'
Dim ws As Worksheet

[Code].....

View 4 Replies View Related

Copy Data From Userform To Multiple Worksheets In Same Workbook?

Apr 25, 2014

I have a userform which loads the data into a worksheet named "Data" which is being used as a database for an event scheduler. I also load a calendar from a worksheet named "Month" so I need the information from the userform "UForm01" added to 2 worksheets.

The userform adds a series of textboxes to worksheet "Data" in the first open row. I also need certain textboxes from the Userform to be added to another worksheet to populate the calendar.

See the code below.

[Code] .....

View 1 Replies View Related

Copy Rows From All Worksheets In Workbook That Meet 2 Criteria

Jun 28, 2014

I have a workbook with many (25) worksheets which all have the same structure, column headings, etc. but vary as to the number of rows. I would like to search all worksheets in workbook and copy to worksheet "120" only those rows where column C is "120" and column E is "1-00053-".

Ideally, input boxes would be used to enter these criteria so that it can be used for different scenarios in which these values will vary.

View 1 Replies View Related

Macro To Copy And Paste Specific Worksheets Into New Workbook

Dec 23, 2011

My problem is as such; each month I receive an application for payment. This will contain around 20-30 worksheets. However I only need to interrogate around 3-4 specific ones. The worksheets I require contain data describing the plant/equipment a company has purchased, or materials purchased over a period of time. Each month the worksheets are updated with the previous months data appended to the bottom. I am required to established if the equipments have been purchased at the correct rate.

The worksheets are all protected thus in order to interrogate them I am required to copy an paste their contents into a new work book in order to format them and insert my new "assessment" columns. I need to keep the work sheets separate in the new work book as they have different layouts however they have the same layout and work sheet names each month.

I needs a macro which would allow me to open up a new book them copy the specific worksheets from a specific file into the new work book. I then have a separate macro which re-formats them into the layout I require.

View 9 Replies View Related

Use VBA To Search Worksheets - If Value Is Found Copy Only Those Sheets Into New Workbook

Dec 5, 2013

I found some useful code for copying specific worksheets into a new workbook based on the sheet name, which I have not been able to alter to suit my needs.

I have a workbook that has a Master Sheet that contains a summary of each claim (Name, type of claim, dates, dollar amounts, etc.) and a sheet for each specific claim.

I know I can use the filter feature on the master sheet to view all of the physical damage claims (and one column has a hyperlink to the worksheet for that specific claim). But every month I have to create a report that shows each type of claim, dates, and so on.

I would like to create a macro that can copy the worksheets to a new workbook based on the type of claim it is. I'm thinking something like for each ws in wb if range ("F15") = 1 & .range ("B4") < 30 days from today copy that sheet into a new wb.

Below is a generic and far smaller version of my workbook. The name column contains my hyperlinks to the specific sheet. Each sheet is also named based on the text in the name column (so John Doe's sheet would be named 'John Doe') and so forth.

Date of Loss
Name
Cargo
BI
PD
Paid
Reserves

[Code] ........

View 1 Replies View Related

Copy Values Between Worksheets

Dec 9, 2007

Assistance w/ this line of

If Not isempty sheets("PCCombined_FF"). cells("I4:I"&lrow) Then sheets("Discounts").cells("I4:I"&Lrow).value_
=sheets("PCCombined_FF").cells("I4:I"&lrow).value

Function for code is to look at cells in col. I on the sheet "PCCombined_FF", If the value is not blank then that value will populate the next open cell on sheet "Discounts" in col. B beginning in row 2.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved