Excel macro to copy data from one sheet to another

I'm looking for an excel macro that can copy rows from one sheet to another within excel based upon having a specific word in the cell. I have one sheet called master and sheet two called feedback. Here is an example of the data:

A B C D mary bob 56 reply soon sam john 26 keep in touch sylvia pan 15 response needed

I'd like to copy the rows sheet "master" to sheet "feedback" if the data in column D contains either the word reply or the word response somewhere within the paragraph. Additionally I would like to be able to fill in columns E and F in sheet "feedback" once the data has been copied.

Thank you in advance for your help!
hrhr


Hello!

I have to copy data from one worksheet (which regenerates data every week) to another worksheet, with the following conditions

1. Column A should have today's date
2. Source sheet has columns A-W. Target sheet should have this same data from B-X
3. New data from the next week should be copied below the existing data

I am very new to excel macros and would appreciate any help with the code.

Thanks in advance,

Mihir

Hi: I'm using Excel 2003, version 11 and am trying to reformat data from one sheet to another. What I would like to do is copy the rows for each team from the Input sheet (Input tab) and and use them to build rows on the Output sheet (Output tab) for each possible combination of players.

In my attached example, a three person team has three combinations and a five player team has ten combinations and so on. I know this is probably a loop within a loop but I can't seem to get the right combination. Not all teams are full yet so the number of players on a team will vary. I need macro code to make the input sheet look the output sheet.

Any help is appreciated.

The attached file does not contain macro code.

John

i have to copy data from one sheet named as "Data" from multiple workbooks.

there are total 12 sheets. and i have to copy data from "Data" sheet from these 12 workboos to one sheet. Each workbook has different name. Data to be copied has same table/headings

is there any way to do this by query / pivot table or by macro ?

Hi

I have two workbook having 8 worksheet each. Every day I need to copy data from previous day worksheet and paste it on new workbook with same sheet name.

For example :-
Workbook1 is having sheet named aa, gg, tk .....
Workbook2 is having sheet named as same as Workbook 1

Now, I want macro to copy data from Workbook1, sheetname 'aa' and paste the same in workbook2 in sheet name 'aa' and likewise

Hope I am clear in explaining my problem

Any help please.

Thanks

Hi,

I got the following code from this forum to copy data from one sheet to another. Is it possible to use it with an input box code. So instead of always getting data from a specific range, it may be selected through an input box and copied on desired location with the help of also an input box.

Sub CopyData()

    Worksheets("Sheet1").Range("A1:E2").Copy
    Worksheets("Sheet2").Cells(Rows.Count, "B").End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues
    
End Sub
So range from worksheet (Sheet1) may be selected through an input box and then again the rows count may also be selected in an input box. Thanks.

Flower R

Hi All,

I am new to Excel Macros and need experts Help, I was stuck up at Compare and copy data from one sheet to another sheet in Excel 2007.

I have a excel workbook which contains 3 sheets(sheet1 , sheet2 and sheet3). Sheet1 is master sheet of sheet2 and sheet3 means it will get data from these 2 sheets, so sheet1 columns are combination of sheet2 & sheet3 columns.

sheet2 & sheet3 are linked with different external sources and when ever changes will occur in external sources automatically these two sheets will get updated . so always these sheets are having latest data .

but sheet1 is getting data from sheet2 and sheet3, sheet1 is not updating every time when sheet3 got update ,since we are not automated the connection between sheet1 and sheet3.

our objective of this Macro is , it should compare the sheet1 and sheet3 based on Request Number(it is a unique and common column in both sheets) and needs to copy the whole row corresponding to the request number from sheet3 which does not exists in sheet1 and paste the data into corresponding columns in sheet1. we need to make sure that no duplicate values are occurred in Request Number in sheet1.( example sheet1 have 10 rows and sheet3 have 13 rows, in both sheets 10 rows are identical and remaining 3 rows added newly in sheet3. now we need to copy those 3 rows into sheet1 into corresponding coulmns)

here i have attached the macro code, it is working fine up to some content but not satisfying my requirement.

Any help would be highly appreciated.

thanks in advance.

Regards,
Mallesham

Hello:

I am in the throes of trying to get an Excel 2007 macro to work. I am a relative newbie to VBA programming and macro writing and can use some help.

I am trying to create an Excel 2007 macro that copies data from one worksheet to another.

Worksheet#1
Clmn1 | Clmn2 | Clmn3 | Clmn4
Row1 Mark | 5 | 1 | 3
Row2 Bob | 3 | 0 | 0
Row3 Renee| 2 | 1 | 7

Worksheet#2 (Output of Macro)
Clmn1 | Clmn2 | Clmn3
Row1 Mark | 5 | 3
Row2 Renee | 2 | 7

**NOTE**:
The output of the macro is Worksheet#2
(a) only when there is a 1 in Column 3 of Worksheet#1 should an entry be made in Worksheet#2
(b) Column 2 of Worksheet#2 matches to Column 2 of Worksheet#1
(c) Column 3 of worksheet#2 matches to Column 4 of Worksheet#1

So when the macro executes, it should, in this order:
Go to Row1 in Worksheet#1 and see if there is "1" in Column 3. If the answer is "yes," then Mark's data should copied to Worksheet#2. The macro should move down a row in Worksheet#1. If there is not a "1" in Column 3's cell for that row, then the macro should bypass and move to the next row in Worksheet#1 and perform the same query.

In my actual Worksheet#1, the criteria value is in column 43.

Thank you!

PROBLEM:
The output of the below macro puts the word "HEADER" in cells A3 thru AS3 of Worksheet#2. When I re-run the macro, the same word appears in cells B3 thru BS3 ... so now there are two rows with the word "HEADER." And so forth.

None of the values from Worksheet#1 are copied over. Arghgh.

-------------------- MACRO START HERE -------------------------------

Sub Macro1()
'
'
' Delete the existing Summary Worksheet and replace with Summary
' Worksheet template and then rename the copied template to
' 0DO NOT DELETE SUMMARY

Sheets("0DO NOT DELETE SUMMARY").Select
ActiveWindow.SelectedSheets.Delete
Sheets("5DO NOT DELETE Template2").Select
Sheets("5DO NOT DELETE Template2").Copy Before:=Sheets(1)
Sheets("5DO NOT DELETE Template2 (2)").Select
Sheets("5DO NOT DELETE Template2 (2)").Name = "0DO NOT DELETE SUMMARY"

' Copy rows in the License Baseline that have a 1 in the field designating that the row is populated

With Sheet2
.Range("1:1").Insert shift:=xlDown
.Range("A1:AS1").Value = "Header"
.Range("$A:$AS").AutoFilter Field:=43, Criteria1:="1"
.Range("A:AS").SpecialCells(xlTextValues).EntireRow.Copy
End With

' Paste those rows into the Summary Worksheet

With Sheets("0DO NOT DELETE SUMMARY")
.Range("A3").PasteSpecial Paste:=xlPasteValues
.Range("3:3").Delete shift:=xlUp
End With

With Sheets("0DO NOT DELETE SUMMARY")
.Range("3:3").Delete shift:=xlUp
End With

End Sub

Hello to all!
I have two excel files and want to copy data from one file to another. My copping array in first file is not continual in other words I have a lot of rectangles of data in Excel Sheets. How can I copy all this rectangles (I know their address) most quickly to other Excel file?

Hi All,

I have one problem which i need to solve. I am a begineer in excel also dont know VBA. Please let me know if it can be done.

Example:- I have a huge data in one sheet, What I need is
1)Start Macro
2)Go to the particular colum (in this case its "Created Date")
3) use Greater than -> 12-02-2010 23:59 - filter
4) Less than equal to -> 12-03-2010 23:59 - filter
5) whatever data comes should be pasted in new sheet.
6) Macro end

I am attaching the file, but the data in file is very less.
Kindly help

I have a macro that basically copies data from one sheet to another (within
the same workbook). When I run it, the second line below give me Error 13 -
Type mismatch. All relavant cells are formatted exactly the same, and all my
variables are singles.

ReportSht.Cells(CurrRow, 4) = (MasterSht.Cells(i, 8) + _
MasterSht.Cells(i, 9)) * ReportSht.Cells(5, 3)

ReportSht.Cells(CurrRow, 6) = (MasterSht.Cells(i, 10) + _
MasterSht.Cells(i, 11)) * ReportSht.Cells(5, 3)

I'm running the attached macro to copy data from a one sheet on a workbook to another sheet within the same workbook. I'm looking to copy every 6th line of data from one sheet, and then display it on the other sheet without any blank lines. The attached coding does allow me to achieve this; however as the spreadsheet I am copying the data from is quite lengthy I obviously don't want to run lines and lines of code to achieve the result I need. How do I optimise the attached code to do this?

Sub Button60_Click()
Sheets("Status Report Jan-Jun").Range("C7:z7").Copy _
Sheets("Timeline").Range("c65536").End(xlUp).Offset(1, 0)
Sheets("Status Report Jan-Jun").Range("C13:z13").Copy _
Sheets("Timeline").Range("c65536").End(xlUp).Offset(2, 0)
Sheets("Status Report Jan-Jun").Range("C19:z19").Copy _
Sheets("Timeline").Range("c65536").End(xlUp).Offset(3, 0)
End Sub

Alan T

Dear all,

I'm using code depicted below to copy data from 4 sheet tabs to an another one (within same workbook), one by one and one below one. Issue i have is "4 sheet tabs" have same headers (A1:D1 row) and i want macro to copy headers from 1st sheet only, followed by data from all the sheet tabs (excluding headers/top row). However it keeps bringing back headers from all sheet tabs as well as the data.

Sub CopyBilling()
Dim sht As Integer
For sht = 2 To 5
Sheets(1).Activate
Range("AA1:AO1048576").Select
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate
ActiveCell.Select
Sheets(sht).Range("A1:E1000").copy Destination:=ActiveCell
Range("AA1:AO1048576").Select
    Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False).Activate
        ActiveCell.Select
        Next
        ActiveWorkbook.Save
        End Sub
Regards,
Intellectual

Hi,

I want to have a macro to retrieve records from one sheet based on criteria from another sheet and then paste the data in a new sheet for every criteria mentioned.

I've attached a workbook with sample data for reference.

In actual, the sheet has huge amount of data, so it's not possible to filter the data and then copy paste it.

I would really appreciate if someone can help me out in this.

Thanks in advance!

All, I'm looking for a simple Macro to copy data from sheet1 to sheet2 based on a defined date range.
My spreadsheet has data from column A to Q and Row 5 to 10,000.
The date is in column F. I need to copy all the data within the following date range to sheet2:
3-29-08 to 6-27-08

Thanks for your help. Macro would be preferred as the people who will be using the sheet on an ongoing basis are not excel savvy.

Thanks.....

Good Morning,

Forgive me if this is a silly or simple question. I am wondering if it is possible to set up a Macro to copy data from Word to Excel.

The scenario is this - we receive feedback forms in Word format. At the moment, we transfer the data on to Excel manually and make calculations and reports from there. I know how to manipulate the data using a Macro once it is in Excel but was unsure if the transfer still has to be manual?

Also, there will be a large number of these Word documents coming in and they will be returned randomly. I therefore also need to be advised i the document will need to be saved somewhere or as something for the Macro to work.

Hope this makes sense. All advice appreciated.

Em

Hi,

I want to be able to automatically copy data from one sheet to another sheet
on the last day of the month (the sheets are in the same workbook) when the
user opens or saves it (either way would be fine)

On sheet 1 there is a running total say cell C3 and on sheet 2 the
destination cells Jan, Feb, March etc.

Is there a way to have my running total populate the correct months figures
while keeping the previous months total. Just now the user manually inputs
the figures but if I can automate this task it would save time for the user.

I hope that I have explained the problem clearly enough.....

Any help you can provide would be appreciated.

Gav.

I am looking to copy data from one sheet to another based on the value in a to columns. If column "N" contains "WDWO" and if "I" is less than "600" then I need to move three fields in that row to a different sheet. the fields that need to be moved are in columns a, e, j. I have attached a sample of the sheets before and after. My original sheet is sheet 1 and my filtered sheet is sheet 2. As always thanks ahead for the help and it is much appreciated! And I need this in a macro so I can automate this process because I have to do this with 8 different sheets.

Hi

Nice to meet you all here. I am a newbie in vb and also a new member to Excel Forum.
I have encountered some difficulties in creating macro in excel where I need to copy data from Sheet1 row A1:C3 into Sheet2 column A1:C3 as well. Which means Sheet1 is a table whereas Sheet2 is a form. The idea now is to copy the data horizontally(row) become vertically(column) in each wordsheet respectively. Attached is the sample showing the simple requirement. Appreciate helps from anyone. Thanks.

Hi,
I want to copy data from multiple sheet and paste in a summary sheet. Every days the number of increases, from where i need to copy the data. Can we write a macro such that it automatically copy the data from all the sheet for the specified field and past in summary sheet.

In my workbook there are suppose 20 sheet and i want to copy the data only from 15 sheet. I have created two sheet blank to make boundary to identify the sheets need to be copied. Header is A2 to A15 and data is in B2 to B15 of each sheet. In the final sheet where i want to copy the data i have already added header as A2 to A15, now i want to just copy the data from cell B2 to B15 of all the sheet.
Please help me on this.

Formula Function that copies data from one sheet to another!!

Hi, im looking for a formula that will do as follows..

I have one spread sheet that has all my Parts list that need to be made and on another sheet i have a list of all my parts that are complete..

I want to automaticaly update my other sheet..

spreadsheet is broken in to sections..

Part # | Descrip. | EST HRS | DATE Comp.| Precen. Comp.|
....1521 |..... motor |.... 1.5 ... | ... .... 9/6/06 | ... ....100% |
.
so what i want to do is once the part is 100% complete is to copy the entire row to the second sheet.. is it possible..??
.
.

Hello,

I need a Macro to copy data from file A to file B. It need to copy data from Column A till Column H of file A in file B. I want to run this Macro from File B.

I hope sample sheets are not required for this.

Regards,
Humac

Hi there,
I need to copy column datas from one sheet to another. For example in attached, I want to copy the date from column E of sheet 2 to sheet1 column D with corresponing ID rows. Another example is: the row2 has same name in both sheet. And I would like to copy the termdate of sheet2 to row2 of sheet1.
I am sure it is doable for master people.
Thanks for your help.

We have a company and need assistance in automating workflow.

The Master sheet contains incoming mail details by customer. Each employee is assigned a set number of customers to respond to. We want the information on the Master sheet to filter to a specific employee assigned sheet. On the employee assigned sheet, once filtered, they are to provide updates in column E

Date Reference no. Name Employee ID 16-Feb-12 S/S/1 Jane Doe KB 16-Feb-12 F/S/2 John Smith DW 16-Feb-12 F/S/2 Mavis B KB 16-Feb-12 F/S/2 Hope Tower KB 16-Feb-12 F/S/2 James Frank DW 17-Feb-12 F/S/3 Fred C SH

We need a macro that can filter customers' details to the specific employee assigned sheet based on the employee ID in the master sheet. For example, all customers assigned to DW (i.e with the 'DW' employee ID) filters into a sheet called 'DW'. Please note that the Master sheet is a continuous log updated daily. This macro must not duplicate information previously filtered once the employee enters a status update in column E.

I need to copy data from one sheet to another in the same workbook. The data is never the same and can change without notice. Here is what I need to do:

The trigger will be in column A with the cells content being 1 through 85 (never all 85 numbers though, mostly 1 to 10 sheets need to be created). As I said it is not consistent and sometimes new ones are added or some are deleted.

For instance, if you find a 1 in column A1 and there is not a sheet named "1" then create it and copy all of the rows that have a 1 in column A. When column A changes to another number say 5, create a new sheet and redo the above until all is copied into separate sheets. My problem is that I don't know how to create a new sheet when the number in column A changes.

I hope that this makes sense and someone can help me with the code. Thanks.