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


ADVERTISEMENT

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

Import Only Selected Columns From Different Workbooks To Master Workbook

Apr 15, 2014

I'd like to import column A,E, H, and I in different 11 workbooks in MYdocument folder to one Master workbook.

I'd like to import 'Name' and ' ID' in cell E3 and C3 in each different 11 workbooks to cell A1 and cell B1 in Master workbook.

Starting row for Column A,E,H and I are 'row 6' because row1 thru 5 are title, name, and comments.

In the Sheet 1 in Master workbook will be the Main sheet for command buttons, so I want to import after Sheet1 in Master workbook.

I want to import each worksheet , not stacked type. I got 11 workbooks in my document right now, but numbers are always changing. I also import in row 2 in Master workbook because I need to add title or button on row 1 in Master workbook.

How can I import only selected columns from row 6 into row 2 in master workbook?

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

Macro To Copy Selected Columns

Aug 24, 2009

OK, I want to run a macro that will:

(1) go in to sheets 'A', 'B' and 'C'
(2) find all cells in row 1 that equal "1"
(3) copy the entire column and paste as values

View 13 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 User Form To New Workbook

May 12, 2009

Have 2 workbooks very similar and need to copy a working user form to newer workbook. Exported and Imported the user form to the new VBA project but can't figure how to bring user form into the new worksheet.

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

Macro To Compare Values In User Specified Columns And Return To Different Workbook

Feb 21, 2014

I am trying to create a macro that will compare several un-formatted workbooks and copy just what I want to a workbook of my one.

I start by having 2 different workbooks opened ("Main" and "Change") side by side like this: 1.jpg

Then i run the macro in my "Main" workbook and it should appear an Userform like it showed in the image below: 2.jpg

This is so that i can manually fill the user form with the correct columns by looking at the excel file, for example:
Ref=E3;City=G3; Data=I3.

Pressing Ok, it fill the "Main" workbook with the matching information so it and closes the "Change" workbook.

At the moment my code is in this stage:

VB:
Private Sub CommandButton1_Click()
myfile = "C:Userssst1brgDesktopRelatorios" & TextBox1.Value
Application.Workbooks.Open Filename:=myfile
Windows.Arrange ArrangeStyle:=xlVertical

[Code] .....

But I am stuck because there isn't any error and nothing happens.

View 1 Replies View Related

Macro To Ask User Which Tabs To Copy To New Workbook

Jul 16, 2014

I have a worksheet that contains about six different tabs. When this form is completed some users might want to have certain tabs copied into a different workbook. Unfortunately each user might want to copy different tabs. I was wondering if there was a Macro that I could write that would ask the users which tabs they want to copy into a new workbook.

View 4 Replies View Related

Macro To Copy Selected Columns And Paste In New Sheet

Aug 24, 2012

I have a sheet that has columns from A to BS, and the column headers start in Row two.

I need to 1st filter the data by Column E where the data in Column E should not contain a particular Value, like"Sleeve".

Then it needs to copy the Columns A,D,G, BN, BO, BP,BP,BR & BS.

And it needs to delete Rows 3 & 4 from the current sheet, before pasting it in a new sheet.

And at the bottom of the sheet it needs to give me a count of the rows and the month end date for each month.

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

VBA Code To Copy Selected Multiple Columns To Multiple Rows In Excel

Mar 13, 2014

I want to to copy selected columns of sales data into rows organized by salesperson. I have just started out with VBA and find that I cannot do it myself.

My original data are in the form of the following:

invoice_no
product
sales
qty
total

[Code] .....

I want to display the data in another sheet in the following format:

sales_a
sales_b
sales_c
sales_d

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

View 2 Replies View Related

Macro To Copy Columns From One Workbook To Another?

May 26, 2014

I have the code below which copies columns A:C from Book1 into Book2. However, it does not work when the Book1 is not open. I would like the macro to still work when the Book1 is closed.

Sub CopyColumnToWorkbook()
Dim sourceColumn As Range, targetColumn As Range
Set sourceColumn = Workbooks("Book1").Worksheets("Sheet1").Columns("A:C")
Set targetColumn = Workbooks("Book2").Worksheets("Sheet1").Columns("A:C")
sourceColumn.Copy Destination:=targetColumn
End Sub

View 2 Replies View Related

Copy Multiple Columns Between Every Nth Column In Another Workbook

Apr 28, 2014

I have two worksbooks both with a big load of (filled)columns, now i want to copy the columns from the first workbook between the columns of the second workbook, the only thing is that in the first workbook the columns are nicely put together, i want to copy them in the second workbook but here they must me placed 7 columns apart from eachother. This is because the other columns are already filled with other data I need. Is there some way to do this.

View 5 Replies View Related

Copy Two Specific Columns From One Spreadsheet To Another In Same Workbook

May 29, 2014

I'm looking to write a macro code that copies two specific columns to a separate spreadsheet in the same workbook, and then sort the rows by values in ascending order.

View 5 Replies View Related

Copy Columns And Paste Into Different Worksheet In Workbook?

Jun 11, 2014

I want to copy 4 columns and one cell to different sheet. I have 'Main' sheet and 'Report' , 'Report(1), 'Report(2), 'Report(3)' and so on. In this 'Report', I'd like to copy column A,E,F, and J and paste to column B, C, D, and E in the 'Main' sheet. I also copy Cell C3 in 'Report' sheet and paste in column A. The cell C3 is ID.

[Code] .....

I need to check every 'Report' sheet for copying and put these records into 'Main' sheet.

The first row in 'Report' is 6
The first row in Main is 4

View 4 Replies View Related

How To Copy Specific Columns Form One Workbook To Another

Mar 3, 2014

I have a code that copies a column data from one workbook to another workbook

[Code] .....

This copies only D column to A coulmn of another workbook

I want 2 more columns to copied and pasted in another workbook

G column---- C Column
H column---- E Column

View 1 Replies View Related

How To Use For Each Instead Of User Selected List

Mar 31, 2014

I currently have a macro that takes a user selected name and date and creates a time sheet for the selected name. This works just fine, however i have to select each individual person and run the macro for each person, how to automate that part of the macro, so it will automatically create the said sheet for all person at once, rather than me doing it manually.

[Code] .....

The 'CurrentMonth' variable is user selected from a list, and will remain that way.

View 4 Replies View Related

User Selected Range

Dec 3, 2008

I have a form that asks at what row the user wants to start with a selected range then how many rows to select. There will always be 21 columns selected with this range. I am still learning but it has to do with something on how I am setting the Start object. It is not being recognized.

Dim Row As Long
Dim Selection As Long
Dim Start As Range

Row = txtStartRow
Selection = txtHowMany
Set Start = Range("A" & txtStartRow).Select

Range(Start & ActiveCell.Offset(Selection, 20)).Select

View 9 Replies View Related

Hide Columns, Filter & Copy Visible To New Workbook

Jun 4, 2007

I have an Excel sheet with all client information...For clinical supervision I want my team members to open their own "Supervision.xls" and click a button...this button will open "Client.xls" and select "Client info sheet"...It will then hide rows c,d,g & f...it will then filter column "e" based on the specific caseworkers name ( say "Joe") and copy only the visable columns back to their "supervision.xls" Values only (doesn't effect the colour formating of Supervision.xls) then close "Client.xls"

View 9 Replies View Related

Referencing User Selected Workbooks

Aug 5, 2008

I would like the user to select two files, the macro then inputs a formula that includes vlookup to the other sheet. However i am not sure how to reference each workbook.

Sub InsertLocationContents()

Dim rng As Range
Dim LastRow As Long

'OPEN CSV FILE WITH LOCATION CONTENTS

csvFN = Application. GetOpenFilename(Title:="Select Location Contents csv file")
If csvFN = False Then
' They pressed Cancel
MsgBox "Stopping because you did not select a file"
Exit Sub
Else
Workbooks.Open Filename:=csvFN
Workbooks.OpenText Filename:= _
csvFN, Origin:=437 _ .............................

View 9 Replies View Related

Copy Columns From Multiple Sheets To Single Sheet In Workbook?

Aug 11, 2012

I have a workbook with many sheets labelled as mmm-yyyy. The constant columns in all the sheets are C,E,R,T, and U.

Is it possible to have a macro do the following: Add a sheet called Summary at the end of the workbook. From the last sheet of mmm-yyyy, copy columns C, E, and R to the Summary sheet. Copy columns T and U from all the other mmm-yyyy sheets to the Summary sheet. All the cells need to be centered.

View 3 Replies View Related

Recognize Which Radio Button The User Selected?

Jul 21, 2014

Within a worksheet, I have several radio buttons, allowing the user to select only one of them. Using VBA, how do I recognize which radio button the user selected?

View 1 Replies View Related

Insert Range-named Row At User-selected Row

May 3, 2008

On the first row of a spreadsheet template is a <hidden> contiguous series of conditionally formatted cells (range name "stdRow" =production!$1:$1), with formulas, that I want a user to be able to easily insert at whatever row they might be in a worksheet.

If, for example, the user is at D24, then clicks the [InsertRow] button that I have positioned at the top of the worksheet (in a fixed pane), I want the attached macro to insert an instance of "stdRow" directly underneath the user position (at row 25, in this case). The use's position should still be at D24 when the macro finishes. If the user clicks the button multiple times, multiple rows should be inserted (again, without changing the user's position).

This is what I have tried so far:

View 13 Replies View Related

VBA To Select User Multiple Selected Ranges

Feb 9, 2010

The User has made multiple selections with the mouse. The spreadsheet is filtered. The user will usually make different multiple selections on the following columns: A and X through to AR (inclusive).

I just need some code to capture these various multiple selected ranges so that I can copy the selected range as shown below:

View 3 Replies View Related







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