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


ADVERTISEMENT

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 Selected Sheets

Dec 18, 2008

I use the command ActiveWindow.SelectedSheets.Copy to copy selected sheets into a new workbook. As a result of this line is a new workbook created and a the selected sheets are pasted into the new workbook. Is it possible to paste only values by using a single line like this?

View 2 Replies View Related

Copy User Selected Sheets

Jun 5, 2006

how you would write a macro to move a selection of sheets to a workbook called Digi's in the D drive. Also if there isn't a Workbook called Digi's already it needs to add one. I've found some code to loop through sheets but nothing to show what sheets the user has selected

View 4 Replies View Related

Copy Selected Cell To Another Worksheet Instead Of Sheets (Interior)?

Dec 24, 2011

How do I copy the selected cell to another worksheet instead of sheets("Interior") ?

Code:
Private Sub OptionButton1_Click()
With Range("B19")
.Font.ColorIndex = 3
.Copy Destination:=Range("P19")
Application.Goto Sheets("Interior").Range("C20")
End With
End Sub

View 3 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 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 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 Data From Multiple Sheets In Workbook To Different Workbook But On One Worksheet

Feb 7, 2014

I am looking for a code that would copy the data from each worksheet in a given workbook and then paste to just one worksheet within a different workbook. The Sheet names are auto generated when I run this canned report but the naming structure is always the same...the first worksheet is named Repair Details and then the next sheet is named Repair Details_1, the next sheet is named Repair Details_2 and so on for every sheet in workbook. So I would like to copy all of the data(Headers to last cell) and then paste in a worksheet(ex: Master Repair Report.xlsx and the worksheet could be titled Master Repair Details) on a different workbook, then the next sheet would copy from the one under the header to the last record and paste to the same workbook. This process would repeat for every worksheet in the Repair Details Workbook and paste to Master Repair Details worksheet in the Master Repair Report workbook.

View 4 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

VBA Copy Sheets Into New Workbook

Jul 31, 2014

I'm using a tutorial I found here: [URL] ....... to copy specific sheets to a new workbook.

I'm successfully able use the script but I'm wanting to adapt this ever so slightly.

The section of code where the change needs to take place is as follows:

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

View 4 Replies View Related

Copy To Different Sheets In A Different Workbook

Mar 14, 2007

When I copy data from a source that needs to go into different sheets on a different workbook it works great as long as the destination is sheet 1 or sheet 2. See my code below and I'll explain further.

Lrow = 45
Lrow2 = Workbooks("Summary.xls").Sheets(1).Range("A65536").End(xlUp).Row + 2
Sheets(1).Range("G" & Lrow & ":K" & Lrow).Copy Workbooks("Summary.xls").Sheets(1).Range("a" & Lrow2)
Windows("summary.xls").Activate
Application.DisplayAlerts = False
ActiveWorkbook.Save
ActiveWindow.Close
Application.DisplayAlerts = True
GoTo Finish

There is data in a workbook that is on row 45,columns G thru K. This data changes and determines which sheet in another workbook it needs to be copied to. If the destination is sheet 1 or sheet 2 the code above works great,but if sheet 3,sheet 4 or others it fails. The code in all instances is identical with the exception the destination sheet numbers change.

View 9 Replies View Related

Copy All Sheets To Another Workbook

Dec 6, 2006

Sheets( Array("A", "B", "F")).Copy

Is there a way to copy all sheets in a workbook ( with macro ) where you do not have the sheet names / variable names.? I am opening a sales workbook from a master workbook and need to copy all sheets to the master however the tab names and sheet numbers are variable and cant seem to find the correct way to do this.

View 6 Replies View Related

Copy Sheets From One Workbook To Another

May 22, 2008

My code copies the worksheets up to a point, but stops after the 18th sheet or so. Is there some limitation on copying worksheets into workbooks? How can I work around it? The error I get when copying 19th sheet or so is "Run-time error '1004': Method 'Copy' of object '_Worksheet' failed".

For Each vControl In frmCurrencies.Controls
sCurve = vControl.Caption & "STS"
If (vControl.Value = True) Then
If Not IsLoaded(sCurve, wbActive) Then
Set wsTemplate = wbTemplate.Worksheets(sCurve)
Application.StatusBar = "Loading SwapCurve Template: " & sCurve & "..."
wsTemplate.Copy before:=wbActive.Worksheets("CONFIG")
Application.StatusBar = False
End If
End If
Next vControl

View 2 Replies View Related

Copy Workbook Sheets To New Workbook

Oct 17, 2007

I am unsure where to go from here. The sheets are named with numbers 1 thru 100.

With a cell reference "D1" that selects the corresponding page, 1 - 100, I want to select it along with the other sheets in the array and copy to a new workbook.

Dim i As Integer
i = Sheets("I-CF").Range("D1").Value

WB1.Sheets(Array("I-CF", Sheets(i).Name, "Util")).Select
Sheets(Array("I-CF", Sheets(i).Name, "Util")).copy

View 6 Replies View Related

Copy Multiple Sheets To New Workbook?

Mar 31, 2014

I am looking for some code to copy the exact values in a couple sheets over to a new workbook. There are images in the sheet that need to come over and formatting of cells including merging.

View 2 Replies View Related

One Workbook - Copy Data To Different Sheets

Mar 6, 2014

I have a workbook (Sheet 1 contains - 6 columns and 1000's of rows). Column B has sensor type. Is there away to copy all data the deals with each sensor and paste it on a new sheet in the same workbook and name these new sheets by sensor type

Example
Date Sensor IP Address DNS Error
1/1/2014 Unix 1.1.10.10 fatty clock error
1/1/2014 HP 1.1.2.3 slim power isues

Please note I have over 50 sensor types.

View 4 Replies View Related

Copy Row From One Sheet To Many Sheets Within Same Workbook

Apr 13, 2012

I'm trying to find the simplest way (macro I guess) to copy a row into a corresponding workbook. This is for a registration workbook.

This workbook has a demograhics sheet (the main sheet), which will have the persons name, dob, and a few other identifiers. It will also have a column for a registration person to enter the of the 4-5 workshops/classes that a student can be enrolled in. For the sake of argument these will be numeric, comma seperated values 1,2, 3 etc.

I'll then have many sheets (one for each class) that are named 1-Employee Morale, 2-Interoffice Relationships, etc.

Is there an easy way that upon entering a new row in the demographics sheet, the persons name can be copied to the class list? Esentially I'm trying to have one master list of all students and the classes they are signe dup for, and then a printable list for each class that can be given to the instructor.

I know you could probably do a macro, run it once, and do it after everyone is registered, but we would prefer that the data populate based on a trigger or something as each row is entered. The sheets for each class could be named numeric so if you entered 1,2,3 as the classes then the sheets 1,2,3 (names) would be populated.

View 1 Replies View Related

Copy Sheets Data To Another Workbook

Apr 16, 2009

I have workbook named "Distribution and Revenue" which is contained 14 sheets , which names are like "UB Distribution", "UB Revenue",
"SB Distribution", "SB Revenue". I want only all Revenue Sheets Data (leaving Last Row) to be copied to another workbook "F:DataFinal Result.xls" in sheet named All Revenue.


For example:

UB Revenue

BCDEFGHIJK2Product Quantity DetailProduct Revenue Detail3DateRTDPSETURTDPSETUTotal Revenue41-Apr-09 1,150 500 2 200 989 475 76 190 1,730 5Total:- 1,150 500 2 200 989 475 76 190 1,730 ............

View 9 Replies View Related

Copy All Sheets To New Workbook As Values Only

Sep 1, 2006

Does anyone know of a line of VBA code that selects all sheets in the workbook (including hidden sheets)?

View 9 Replies View Related

Copy Workbook Sheets To New File

Jun 6, 2007

I am having difficulties copying a entire workbook into a separate new workbook (to make a number value copy for printing and saving purposes). My problem is the hidden sheets are not always hidden and the unhidden sheets are sometimes hidden. This all depends on a different macro that i am running through the workbook.

example:
sometimes i need sheets 1,2,4 to be copied to the new workbook
other times i need 1,2,3 to be copied to the new workbook

View 5 Replies View Related

Copy And Paste Various Items To Three Different Sheets In Another Workbook

Jul 24, 2014

I have a workbook open, and want to copy and paste various items to three different sheets in another workbook.

When it comes to pasting the data however i am getting the error "Run-time error '13': Type Mismatch"

VB:
Sub BR_0153()
Dim Inv As Workbook, BR As Workbook
Dim RR As Worksheet, LH As Worksheet, IP As Worksheet
Dim LastRow As Long
Set Inv = ActiveWorkbook 'sets current workbook as Inv

[Code] .....

View 1 Replies View Related

Copy Sheets From Another Workbook Without Named Ranges

Nov 16, 2009

I have VBA code that copies over several sheets from a workbook, but I'd rather not have all the named ranges come through. Whenever I run the macro it gives me this notice: "A formula or sheet you want to move or copy contains the name 'rngRegion2', which already exists on the destination worksheet..." The destination sheet doesn't originally have this range already, it runs into problems because the sheets I'm copying have rngRegion2 defined on different sheets. I'd like to try and avoid this problem all together by not copying named ranges if possible.

If thats not a viable option, is there code that I can use to tell it to automatically select "Yes - To use the name as defined in the destination sheet" as opposed to prompting the user to select yes/no?

View 2 Replies View Related

VBA Code To Copy Data In Different Sheets Of Workbook?

Jan 25, 2012

I am using the following code to copy data from multiple workbooks in a folder to one workbook.

Code:

Sub copy_files()
Dim wkb1, wkb2, wkb3 As Workbook
Dim i, lastrow As Integer

[Code]....

What changes are required in the above code to paste the data in different sheets on one workbook.

View 2 Replies View Related

Copy Records From Multiple Sheets Into New Workbook

Feb 2, 2012

Following problem:

I have a workbook containing data about some students grade on different sheets (4). The structure is almost the same on every sheet:

The first 2 row contain headers the each row contains a name and result for different test:

name - test A - test B - ...etc.
Peter - 90 - 60 -....etc.

there are 25 columns on each sheet - 4 sheets in all.

What I want is, to consolidate each students results in a separate workbook.

View 1 Replies View Related

Copy Sheets From One Workbook To Another And Maintain The Order

Mar 15, 2012

I have code to copy sheets from one workbook to another, but how to maintain the order based on the Source Workbook.

Actually what i'm trying to do is copy all the Sheets named start with "_". FYI, i cannot use the Index of Sheets as well.

Code:

i = 0
For Each ws In Workbooks(xWBSource).Worksheets
If ws.Name Like "_*" Then
i = i + 1
sArrSheet(i) = ws.Name

[Code]...

View 1 Replies View Related

Copy Row From Series Of Sheets To Sheet 1 In Workbook

Apr 20, 2012

Haven't done any VBA in a long time so I'm very rusty. I need to copy cells A2 - G2 from sheets 2 - 30 in a workbook to create rows Sheet 1, which will start out blank. This is the final part of longer process. Sheet 1 is used as a summary page.

View 2 Replies View Related







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