Copy Data On New Lines From A Source Sheet Based On Criteria
I have a source sheet which contains data. Within this data there is a column (column 3) called Name and I would like to take the data from this sheet and paste it onto a new sheet but in grouped format. So take all instances where it finds criteria 1, then 2 and so on and just paste it on a new line each time it finds a criteria. So far I have the following code to search
Sub loopy()
Dim rngTemp As Range ' the range variable declaration
Dim intCounter As Integer 'counter as integer
' the following loop goes through all the cells in column a up until the last used cell in the column
For Each rngTemp In Range("a1", Range("a" & Rows.Count).End(xlUp))
'increment the counter if the cell has value fridge
If rngTemp = "Fridge" Then intCounter = intCounter + 1
Next rngTemp
MsgBox "There were " & intCounter & " cells equal to Fridge"
End Sub
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Macro To Copy Data To Other Sheet Based On Criteria...
We're working with a large workbook with data from A5:P20000 on sheet1. I need to be able to pull data from sheet1 to sheet2 based on the invoice number in column A on sheet2. Sheet2 will have different invoice numbers in column A, some of these invoices numbers are in column H on sheet1. I need excel to find these invoice numbers and copy the data from that row on sheet2 to the row with that invoice number on column2. Example: Sheet2 A5 has invoice number 1234457 This same invoice number is located on sheet1 H3400 Need to copy to sheet2 (starting in cell B5) the following cells from sheet1 (B3400, C3400, E3400, G3400, H3400, I3400, J3400, K3400, M3400, N3400).
View Replies!
View Related
Graph With Source Data On Multiple Lines
I have an excel worksheet that contains two sets of data. These numbers are then plotted onto a line graph to show the two sets of data against each other. The graph is working fine, but only for a specific amount of data. The data is split into mutiple lines. From cells A1 all the way to BI1 is one row. I then have information in A4 to BI4. I would like to plot this information on a graph as a single continuous line. Is this possible? Basically, My graph source is currently =Data!$A$2:$BI$3. This gives me two lines that I want. How do I get the data from A4:BI4 to join up to the first line in the graph.
View Replies!
View Related
Copy Paste Multiple Criteria Based Rows To New Sheet
I need to copy specific rows that have a specific value in colum B and Colum M to new worksheets. So from attached screenshot , say for an example macro shud filter rows that have "BigPond" in coloum B ,"RG2" in column M & "INT" in column W and i dont want all cells in these rows , i only want copy cells under column C,AK,AL,AM (in this order) to my other excel sheet that is named "BigPond" and it should paste it starting from Row5? I want to avoid recording a macro as it selects a range and i am expecting more new rows every week so if a record a macro the cell range for selection changes and i get incorrect result.
View Replies!
View Related
Copy Based On Column Criteria & Append To Another Sheet
I have a spreadsheet that is used to store statistical information on a monthly basis, some of this information may be incomplete and so will need to be acted upon month by month, What I need to do using VBA is: At the close of the spreadsheet check sheet1 and if there is any data (text) in cells N – Q on any line If there is move to sheet3 check for the next blank line then paste the data from only certain fields i.e. A,B, N-Q,R,S Here is another problem As the sheet will be used on and off during the month I don’t want data that is already been moved across to sheet3 to be copied again so there needs to be someway of checking if the info is already there? I have code now for the find last cell part of the problem. Sub FindLastCell() Dim LastCell As Range With ActiveSheet Set LastCell = .Cells(.Rows.Count, "A").End(xlUp) If IsEmpty(LastCell) Then 'do nothing Else Set LastCell = LastCell.Offset(1, 0) End If End With LastCell.Select End Sub
View Replies!
View Related
Copy Rows Based On Criteria, Paste As Values To New Sheet & Sort
I have spent a few days searching through forums but cannot find examples that i have been able to successfully adapt ( because they are to complicated for my limited knowledge). I have a workbook with 5 sheets, sheet1 (current), and sheet 4 (archive) are the important ones. I need a macro to A) copy rows from "current" to "archive" ( to the 1st empty row) if column S of "current" contains "Closed" ( the word is generated by formula). B) The paste needs to paste special values and number formats ( want to lose formula but not conditional formatting). C) data sort "archives" based on col A - this puts the newly archived data into correct sequence.Data sort lowest number 1st D) delete the copied rows from "current". e) give me a count of how many rows it deleted, (I have a macro to insert rows so will run that manually to recreate the correct number of emtpy rows (with formula and formatting) to bring the current sheet back to usual size. I tried modifying a macro by RPaulson (based on cells on one sheet to cells on another), to work with entire rows but couldn't get it to work. Found that paste special uses PasteSpecial xlPasteValues, but , and thats about it.
View Replies!
View Related
Copy Data According To Criteria To Another Sheet Within The Workbook
i need a macro that will copy data according to criteria to another sheet within the workbook, Raw data is in Sheet "Workings" from range A1:L,???? (not fixed), i need the macro to filter Col b and look for string CBA, CITIAIMS, MIR ASIA, STATE STREET, CITIBANK, REG then copy all data relating to these string to Sheet- " Cash_To_External_Custodian" Workings Account CodeCustodianSourceValue DateBreak DateAgeSideCCYLedger AmountStatement AmountAmount DifferenceError TypeQLGACITIAIMSDES21-Oct-0821-Oct-08-6SCRAUD0.0063,115.1163,115.115647366QLGSBQLGACITIAIMSDES22-Oct-0822-Oct-08-7SCRAUD0.0011,665.0311,665.035649060QLGSBQLGACITIAIMSDERIV28-Oct-0828-Oct-08-13LCRAUD100,000.000.00-100,000.005661452QLGACITIAIMSDES28-Oct-0828-Oct-08-13LCRAUD18,274.880.00-18,274.885655105 When pasting data to "Cash_To_External_Custodian", i would like the macro to paste to the required columns as per my screen dump below, as you can see i want the macro to skip Col b ,Starting Range is A6 Cash_To_External_CustodianAccount Code Case RefCustodianSourceValue DateBreak DateAgeSideCCYLedger AmountStatement AmountAmount DifferenceError TypeQLGACITIAIMSDES21-Oct-0821-Oct-08-6SCRAUD0.0063,115.1163115.115647366QLGSBQLGACITIAIMSDES22-Oct-0822-Oct-08-7SCRAUD0.0011,665.0311665.035649060QLGSBQLGACITIAIMSDERIV28-Oct-0828-Oct-08-13LCRAUD100,000.000.00-1000005661452QLGACITIAIMSDES28-Oct-0828-Oct-08-13LCRAUD18,274.880.00-18274.885655105
View Replies!
View Related
Return Data To Another Sheet Based On Criteria
Sheet 1 Column A = Dates Row 1 = Filenames I enter a Y in the intersecting cells of the Filenames & Dates to show which files were downloaded. I need is a formula that will rearrange this layout onto Sheet 2 so that each ‘Y’ (downloaded) filename is inserted in a cell corresponding to the Date. (see attached sample)
View Replies!
View Related
Copy Data To New Workbook Based On Criteria
I have a workbook that is used to track job estimates. What I would like to have is a macro that would search through column N on the original file and if any of the cells have "No RFE" in them - generate a new workbook with only this list that would include any data from columns C-U copied from the original file. I've been seaching the forum, but so far have had little luck finding something that suits my needs.
View Replies!
View Related
Copy Data Across Multiple Worksheets (based On Three Criteria)
I have data on a worksheet (“Interface”) that I need to copy over 7 other tabs for analysis. ("Module_1", "Module_2", "Module_3", "Module_4", "Module_5", "Module_6", "Module_7"). The linking Field on the Interface tab defines what row I need to paste the data to on Module 1-7. The column headers are the same on both the interface and other tabs (“YES, NO, N/A, BLANKS, STANDARDS MET, STANDARDS NOT MET, NOT APPLICABLE”) The tab is selected based on the row Module 1Medication Management Module 2Privacy Module 3Process Module 4Patient Safety Module 5Medical Records Module 6Infection Control Module 7Environment of Care I’m trying to modify code written for a similar purpose with no luck. This is the code I'm trying to modify. I know I'm not on the right track yet.
View Replies!
View Related
Macro: Copy Data Based On Criteria/Condition
Attach is a sample of my project. I have to loop through B9:B80 in sheet("Raw Data") and capture the value of each cell. EG: * if Value captured is 120A --> check with sheet("SP14F") from the row which contains the same value. * i have to check that the aperture, outer and inner values of Layer 120A and so on..of the Raw Data sheet is the same as that of in the SP14F sheet. * if the values are not the same, change the font to red i understand that this task requires looping and arrays.
View Replies!
View Related
Copy Row Data To Another Worksheet Based On Criteria
Data exists in a workbook's sheet name "0293" in columns A, B, C, & D. If a row's value in column B exceeds zero, the entire row & formatting needs to be added to the bottom of data in a sheet called "Comprehensive" of the same workbook and put 0293 in column E of the same row. What would be the simplest VBA code to copy sheet 0293's data & add it to the "Comprehensive" sheet with the sheet name in column E of the same row?
View Replies!
View Related
Copy Data From Another Sheet If Adjacent Cell Meet Criteria
I have a have excel problem Im trying to figure out. I have 2 sheets. Sheet1 and Sheet2. I want to copy into sheet1 cell B2 the contents of sheet2 column C row x iff sheet2 column B row x = 1. There will be only one cell in that column equal to 1, so I will be copying that cells(colB; rowx) adjacent cell (colC;rowx) contents. This is what I have so far but it doesnt work. =IF('Sheet2'!B:B=1,DONTKNOW WHAT TO PUT,""))
View Replies!
View Related
Automatically Copy/Paste Data From Input Range Based On Criteria
I have a workbook with 2 - worksheets "DATA" and "LETTER". The "DATA" sheet has columns "First Name" "Last Name" "Address"...etc. The user can enter in either a "X" or a "x" in cells B6:B100 on the "DATA" worksheet. After the user enters a X or x and hits the macro button I need it to copy certain cells from "DATA" worksheet to "LETTER" worksheet. I have listed a example below. In this example if a "X" or "x" is entered into B6 on "DATA" worksheet and the macro button is hit, then: ....
View Replies!
View Related
Copy Data Table Seperate Sheets Based On Column Criteria
I need to copy all the work sheets into one single work sheet (mastersheet). The source work sheets are having same column structure. The condition which i need to take care of is that after column 3 if at all there is any data till column 10 then in the destination mastersheet these should be copied in different rows with first two columns repeated. I need to do this using VBA macro.
View Replies!
View Related
Another Sheet As A Data Source
I want to design a spreadsheet report, but instead of importing the data from an external source, i would like the data to come from another sheet within the same workbook. The goal is that the data sheet will contain only raw data with no formatting, and the report sheet will contain all the formatting.
View Replies!
View Related
Pivot Table Retains Old Source Data In Addition To New Source Data
I have a report that was created for 2005 that contains two worksheets: a "source data" worksheet and a " pivot table" worksheet. I cleared out the 2005 data in the "source data" worksheet and replaced it with 2006 data...after this I refreshed the Pivot Table and everything seemed fine. When looking at the file size I noticed that it was almost twice its original size....upon further investigation I found that the Pivot Table was internally holding onto the old source data (the "Show" functionality of the rows/columns in the table lists the 2005 row/column headers as well as the 2006 headers....even though no data from 2005 is shown in the Pivot Table). Does anyone know how to purge the old data from the internal Pivot Table memory? I hope this is enough information....let me know if you need more. Thanks in advance for any help, Jon
View Replies!
View Related
Copy Chart Without Source Data & Retain Formatting
I have 2 sheets in one workbook; one sheet has a chart with a data table, the other contains the source data for the chart. I want to copy and move the sheet with the chart to a new workbook, but without the source data. I break all links, but then the chart's data table takes the default values and formats in the new workbook after I break the links. For examples, the source data has formats such as currency and no decimal places. However, after copying the sheet, the data table reverts to no dollar sign and decimal places. In addition, the months on the x-axis turn to numbers when the links are broken.
View Replies!
View Related
Changing Chart Source Data Based On Running Date
I currently have a simply bar chart that is based on a running 5 days figure so the X-axis is like 01-Mar 02-Mar 03-Mar ... Y-Axis is the data that I am trying to present - Total $ The source of this data is simply two columns - Column A is the running date, Column B will be data. Daily I need to only present 5 days historical data based on the latest date i.e. today and the past four days (the source data is updated daily). Can a macro be used to auto update the bar charts based on today's date?
View Replies!
View Related
Look Up Value From Master Sheet Based On Criteria In Current Sheet
I'm trying to create a function in a template invioce that will look up a value in another spread sheet (fees).The data will be based off three values entered in the invioce from drop down boxes. I've attached the workbook with the master sheet and the invioce (sheet 5) The three criteria that can be selected is the project, month and name and I want the amount of hours to be returned based on that information in column e. The projects are seperated and billed by month.
View Replies!
View Related
Copy Range In New Sheet By Criteria
I want to copy a range of data in a new sheet using a criteria. First i would like to choose a column, and second the criteria.If criteria in this column is meet , copy all rows in the range that meet that criteria in a new sheet named after the criteria .
View Replies!
View Related
Copy Rows From Selected Sheet To New Sheet Based On Cell Value
i have a workbook that has a lot of sheets but i need to pull information from the one sheet "Veneer Log" i Need it to make new sheets with the same heading as on the "Veneer Log" (Rows 1 & 2) Sheet but it needs to be filtered by the "Product" Column (H) with a new sheet made for all the diffrent products i.e. Dimensional, Drywall, Corners - Thin V., Accents,..... so each product will have a new sheet with i am hoping someone can help me with this. This log changes Daily and it would be nice to have a sheet with only the same product on it to compare new orders so we can batch run. i hope i have given you enough information so someone can help me with this. i have attached a sample log the real log has about 10 worksheet for diffrent departments but i only need info from the Veneer Log Sheet.
View Replies!
View Related
How To Copy Cells Based Upon Criteria
Here's what we need to do: We are compiling one master spreedsheet from many smaller ones and I need to figure out how to copy them quickly and efficiently. For example: Small Spreadsheet: Column B is marked as P, M, C or S. This represents the type of the account. Column C is the name of the account. Master Spreadsheet: We have a column for each account type (P,M,C,S) Can we use a formula/macro to automatically copy columns B and C from the small sheet and organize them accordingly in the Master Spreadsheet? For example: Small spreadsheet: P Account Name1 M Account Name 2 M Account Name3 C Account Name4 M Account Name5 would appear in the Master Spreadsheet as: P M C Account Name1 Account Name2 Account Name1 Account Name3 Account Name4 Account Name1 Account Name5
View Replies!
View Related
Copy Cells Based On Criteria
I have data like in excel, which I uploaded and I need "simple" thing, If in column G is text Australia then copy from D column each cell which has "AUS1*" + copy the same number cell from C column and copy it into cell A and B. I hope I wrote it understandable
View Replies!
View Related
Copy Ranges To Another Based On Criteria
I have a worksheet that has data in columns a through d. Acct#, Name, Usage Code, and Other Code. Acct# and Name are self explanatory, usage code is a two letter code, and other code is a field I added to use with my macro. A specific account number could be repeated many times, but it is the usage code I am needing to work with here. My acct numbers are sorted in numerical order and column d has a 1 each time a new account number appears and a 2 if it is a repeat. I am wanting to copy the account number of any account that does not have a specific usage code listed at least once. That specific code is "ta". I am wanting it to only list the account number once in column f starting at row 2. Here is my code that is not working. Sub test() Dim CopyNum As Integer Set CopyNum = 2 Dim Switch1 As Integer Set Switch1 = 0
View Replies!
View Related
Copy Between Worksheets Based On Criteria
I need to assign to variable the number of cells in axle "Y", I explain them, I have assigned to the variable "Celda" the number "4" that, celda = 4 where 4 is the number of cells where begin the information that i need to copy,at firts they were separated sheets, and the macro it was working, assigning a letter a the processed row in the column of the left, but now is a one sheet, and I need, this macro find the last cells that the contain a letter in the left and assign the number of cells to the variable "celda" dont the range for example "A33" else "33" and begin toward down, I have this Workbooks(origen).Activate Application.ScreenUpdating = False celda = 4 'where the number 4 will be changed for the number of cells in axle "Y" in this case "33" celda2 = 4 cdestino = 1 While Workbooks(origen).Worksheets(1).Cells(celda, 2).Value <> "" dato = Cells(celda, 2).Value Select Case dato Case "Aplicación de material"............
View Replies!
View Related
Display Values Of Another Sheet Based On Criteria
I need to display values from cells of sheet1 and sheet2 as comment in Corresponding cells of sheet3 whose value in sheet3 is FALSE Sub try() Dim Sheet1cellval As String, Sheet2cellval As String Worksheets("Sheet3").Range("A1:D4").Select Dim cell As Range For Each cell In Selection If Worksheets("Sheet3").cell.Value = False Then cell.AddComment cell.Comment.Visible = False 'Getting the value of Cell in Sheet1 for the corresponding cell in Sheet3 whose value is FALSE Sheet1cellval= Worksheets("Sheet1").cell.value 'Getting the value of Cell in Sheet2 for the corresponding cell in Sheet3 whose value is FALSE Sheet2cellval = Worksheets("Sheet2").cell.value 'Displaying the values of cells in Sheet1 and 2 as comment for the corresponding cells in Sheet3 Worksheets("Sheet3").cell.Comment.Text Text:="Difference" & Chr(10) & Chr(10) & "Sheet1: " & Reportcellval & Chr(10) & Sheet2cellval & Chr(10) & ""
View Replies!
View Related
Copy And Paste Values Based On A Criteria
a VBA code to do the following: I have a worksheet consist of some 17,000 records - from ColA:ColDZ. In Datasheet, I have all values. From this, based on some values in ColA all records should be copied into another sheet(s). I have attached a sample workbook in which I have explained the requirement.
View Replies!
View Related
Transfer Copy/paste Based On Criteria
6 worksheets ("Monday" ,"Tuesday" etc) 1 Worksheet (call it Main) In the Main sheet let's say there are 3 column headings - Date, Inv No, Amount I want to copy from the Main sheet to the appropriate day e.g if the dates in the main are13/01/10 and 14/01/10 then all the info pertaining to 13/01/10 should go to the Wednesday worksheet.
View Replies!
View Related
Copy Rows In Range Based On Criteria
which I have modified from one that I use before for sheets 1 & 3 (instead of 4&5) But it isn't working! I have defined a dynamic range in sheet 4, which is the range I want to search (its named "search") should i be using this range in the formula somewhere? Private Sub CommandButton1_Click() Dim rngFind As Range Dim strFirstAddress As String With Sheet4.UsedRange Set rngFind = . Find(ComboBox1.Text, LookIn:=xlValues) If Not rngFind Is Nothing Then strFirstAddress = rngFind.Address Do rngFind.EntireRow.Copy Sheet5.Range("A" & Sheet5.Rows.Count).End(xlUp).Offset(0, 0) Set rngFind = .FindNext(rngFind) Loop While Not rngFind Is Nothing And rngFind.Address <> strFirstAddress End If ..................
View Replies!
View Related
Copy Rows Based On Multiple Criteria ....
I am trying to loop through a column and cut and copy cells containing one of ten or more criteria (text strings) to the next worksheet, which already exists. The basic loop is set up, and I understand that an array for the multiple criteria is needed but am falling at this hurdle, as well as struggling with the routine to copy the row to the next available row on the next worksheet. I have omitted to post my effort so far, as it's embarrassingly basic, but can anyone help with the code?
View Replies!
View Related
Copy Range Based On Criteria That Changes Constantly
I am trying to copy a range of cells, based on a set of criteria that changes constantly. In Column A, I have numerical values that are present every 10th cell. In columns B through D, I have various text data that corresponds to the number in Column A. So for example, in A50, I have the number 46975. In the range B50-D59, I have text data that goes with the number in A50. Each day I run a few calculations and based on the number I get, I want to find the exact match in column A, then copy all the data in columns B through D that are related. So if my calculations result in 46975, I want to automatically copy over to another worksheet the range B50-D59.
View Replies!
View Related
Copy Rows From One Workbook To Another Based On Criteria
I have been struggling to setup these two workbooks for a bit now, and I can't for the life of me figure out a formula to do what I need to do. Essentially, I have one workbook that contains a list of purchase records for my company, sortable by Date, Vendor, Price, etc. and one workbook that has a sheet for every vendor. What I need is a formula that will search column B for a vendor, Allied Waste for example, and transfer all the information within the rows for every instance that vendor is found to the new workbook. This is basically just a way where I can input information once in one workbook, where the sheets are divided by month, and the info will automatically transfer to another workbook, where the sheets are divided by vendor.
View Replies!
View Related
Copy Cells Based On Criteria In Other Cell
I want to copy cells A&B where there is a value in G to a new workbook. I need to loop through the workbook as there are 25 sheets in the workbook, and there 8 workbooks to go through. There are 31 rows on each sheet, and there are only a few values in column G on each sheet. A is customer name, B is Account No, G is Insurance premium paid, columns C to F, and H to M have other accounting data in them. The idea is to create a global list of all customers who have already paid their insurance premiums.
View Replies!
View Related
Copy Every Nth Range Based On Criteria
I am copying from cell A2 to C2, then A8 to C8, etc. if the cell in column "A" contains the text "Item" until the end of data in column A. Here is what I am attempting: Sub MoveItem() sText = "Item" sText = LCase(sText) iMax = Cells.SpecialCells(xlCellTypeLastCell).Row For i1 = iMax To 1 Step -1 If InStr(1, LCase(Cells(i1, 1)), sText) <> 0 Then Cells(i1, 1).Copy Destination:=Cells(i1, 3) End If Next i1 End Sub The problem is the destination location. If I define it as a Range eg: Cells(i1, 1).Copy Destination:=Range("C2") The macro works, but does not iterate the destination cell.
View Replies!
View Related
Copy/Paste Rows Into New Sheet Meeting Criteria
1) I have a original worhsheet_A which with header rows(1~6) and many columns. 2) In the sheet_A, there are 2 columns (ColumnN & S) which I need to set criteria (value>5). 3) If any row's data which meet the criteria (value >5) with either column N or S, copy all the entired rows to sheet_B following sheet_A sequence. 4) The sheet_B should have the same header row with sheet_A(row1~6). Btw, is possible create a corn job trigger this macro to run daily 9am to send out the worksheet_B as email, so that the command button can be disregarded.
View Replies!
View Related
Auto Populating Columns In One Sheet From Another Based On Criteria
I've been trying for some time now to figure out how to have one sheet automatically fill in another based on a larger data sheet. I'm trying to find a way to take a monthly calendar which contains a row for each employee and column for each day and use that to create smaller lists on another sheet. Basically if someone puts in for a day off, or has a medical appointment etc, that person has a coded single letter for that day for tracking and planning purposes. I want to have a second sheet that references those codes and makes individual lists (the following people are on vacation, these people have a medical appointment etc.)
View Replies!
View Related
Copy Rows To Another Worksheet Based Upon Multiple Criteria
I have seen all kinds of copying routines, but haven't been able to get what I want. 1. Copy Row contents from activeworksheet 2. The activeworksheet will have various row counts 3. The activeworksheet has row 1 as header. 4. The criteria to use is in the current worksheet columns P through Z 5. The criteria to look for is the word inspect. only the word inspect, not words that contain inspect (i.e. "inspection") should not be found. 6. The word could be in column P and in S, but needs to be only copied once, becuase it has meet the criteria, but it also could only be in c 7. Copying the row into a Sheet named "Inspection" As a bonus would be cool to be able to copy certain cells or the entire row.
View Replies!
View Related
Copy Rows Based On Criteria In Single Column
I have on sheet1 of my workbook a number of rows of data, from column A through Column G. The Data in column G either contains the text "Yes", or "No". I need a macro that will look through each row in this sheet, and upon finding a "Yes" in the cell in the column G, will copy that entire row (columns A through G) into a new row in sheet2. Sheet2 currently contains data, so I'd like to move everything down by one row and paste this data at the top (row 6 is the first line of data on this sheet). I'd then like to go back to sheet 1, and delete the row I've just copied. Then continue though the loop. The loop needs to stop when a blank row is discovered.
View Replies!
View Related
Automatically Copy Rows Based On Criteria In Column
I'm not sure that I'll be able to explain this clearly, so I've attached an example. There are 3 columns - Issue, Action Group and Status. Many Issues belong to the same Action Group and others do not belong to any Action Group. The is also a Status summary section that has the total Issues and Actions associated with each status. For example the Status called Resolved could have 10 issues and 5 Actions (including blanks). The problem is that I can't figure out a way to get the total for the Actions. As I said this explanantion isn't great, so the attached sheet
View Replies!
View Related
|