Copy Row And Insert Above Where Value On Cell Equals To X
Apr 28, 2014
I am trying to insert a row every time a certain value appears in row.
Example attached.Example 1.xlsm
I need to copy the entire row that has the value 2 in column B and insert it in the line above (not fussy). It must be inserted and move all data in other rows accordingly.
I am trying to figure out how to go down a list of words and copy/paste a row if it equals a specific ring of words. For example, if want to go down a column and copy the word "Dog" if the word is "Dog" and paste it to the second sheet in a certain column... The thing that I can't figure out is how to step down to the next row until the cell is empty.
Sub Cats_and_Dogs() For i = 1 To 100 If Range("i, 1") = "Dog" Then Range("i,1").Select Selection.Copy Sheet2.Paste End If Next End Sub
My workbook stores data related to items that are all tracked by barcodes. Im using the following code (as part of a larger set of code) to copy data from rows 6 on in column D, E & G to K from one workbook to another. The data in F (Item Names) is found using a formula, by matching the barcode data in the corresponding G cell (on the same row) to another sheet (where the barcodes and Item names are stored). When the data has finished copying over and EnableEvents gets turned back on the F column mostly automatically fills itself in from the formula.
The issue I have however is in certain circumstances there are some items that either dont have a barcode, or the barcode is missing. In this case the user types "none" (not case sensitive), which opens a userform allowing the user to type in an Item name that gets entered into the F cell, overwriting the formula. I need to copy this data over separately to the new workbook. Im looking for code to find these records from row 6 on (either by searching for rows where G equals "none", or rows where F has no formula, and then copy the data in F over to the other workbook to the corresponding row number but offset by the number of records already present in the active workbook (currently being calculated by wbReturnDataLastRow).
[Code] .....
wb is the ActiveWorkbook that the data is being copied to mybook is the workbook that the data is being copied from
Attached is the sample workbook. I have a workbook with 2 sheets. Sheet1 contains all question and answer question. When the user select "Comment" as an answer, it will trigger to insert a new row on sheet 2. My question: is there any way I can copy from the comment fill in column c on new row to Sheet1 " Comment column"?
I have a large spreadsheet of demographic data. In column A there is a name, in column B there is Address1 and in column C there is Address2. First I need to insert a new line under each line of data. Then I need the Address2 data (column C) of each line to be copied/pasted to that new inserted line, but in the Address1 column (column B).
I have a spreadsheet with serveral thousand lines. I need to add row(s) and fill-in values based on a value in anothe cell; for example,
Based on the value in Column A, a row(s) needs to be added below the row and a count (value) to B needs to be inserted into the cell in Column B. This step needs to be repeated for all rows to the end of the sheet.
I need to match data in cell A to cell B and then if they equal I need to copy the adjacent cell C to cell X . How do I set up a macro to do this automatically? I have over 5000 cells to compare and match up.. I have Office 2003.
I have a sheet where there is a column showing all the totals of previous entries, however a couple of the cells shouldn't total but just show the last entry.
The cell is for an ongoing count of year to date applications received.
Can anyone tell me a formula that would look for the last data entered in a row and return that value
Sub Test2() ' Select cell A2, *first line of data*. Range("A2").Select ' Set Do loop to stop when an empty cell is reached. Do Until IsEmpty(ActiveCell) ' Insert your code here. ' Step down 1 row from present location. ActiveCell.Offset(1, 0).Select Loop End Sub
How can I set a cell value = to what cell I the loop is currently on?
All good, but on my summary sheet (that is summarising the data in each sheet) I want a cell to return me the name that each sheet is called, but simply saying ='SheetName'!B1 is not working
So how to I get the cell on my summary page to return me the text of the cell that is using the above formula.
I have created a file in which other users use on a daily basis to input their time in and time out hours per activity. There are 16 rows allowing them to input up to 16 activities completed in a day. More often than not they do not use all 16 rows. My issue is that these users are very computer illiterate and will often delete the zero that is in their time in or time out hours on unused rows. This results in their total time displaying "####" I have explained to each of them multiple times to input a zero and their problems will be corrected, but they can't seem to grasp that concept.
How to allow the users to input their times, but if they hit delete on a cell and the cell is blank for it to automatically populate the cell with a zero no matter what the user does. I have all other cells with formulas on the sheet locked, but if I lock these cells then they can't input their times.
The issue with this formula is if D65 is 0...then the result is a negative number. Just for clarity,
D65=0, E65=10%.....
So I end up with -10%. I can't have a negative number so I'm looking if the result is negative then the cell just equals 0. Is this possible with an IF formula?
I am familiar with the macro DeleteRowOnCell, but I want to delete rows when a cell in a selected column has a formulae which is returning empty text. I tried the macro DeleteRowsFastest without success.
I have a 700 line spreadsheet and would like to delete the cell next to another cell if it contains a certain string. I.e if A1 to A3 equals "Test" then i would like to delete the contents of B1 to B3, But if A2 equals "Completed" then only B1 and B3 should be cleared.
So I am having trouble figuring out how to do multiple text to equal multiple numbers. For instance right now I use =IF(E9="JOHN DOE","07", but I would like to have it where IF E9 = John Doe the cell shows 07, but IF the E9 = Sam Doe I want the cell to show 08, and the same IF E9 = Pat Doe the cell shows 09 and so on.
Meaning is there a way to have multiple functions go to a cell dependent on what is entered into E9 for example. I just want to have a number come out in one cell if a certain name is entered in a different cell. I loooked at this post [URL]....which got me started,
I am looking for a formula to allow an image file to show when a cell equals a certain text string. If it can be done can it be achieved with multiple images? I am making a database that will calculate from many variables my required glass sizes, given the size and window type and I was hoping to go one step further by making it raise a purchase order from a series of images and other related data.
Is there any way of playing a sound (or even better, speech) whenever a specific cell equals a certain value or contains a certain string (such as "Alarm")? This has to happen automatically as the cell updates and require no interaction.
I have a spreadsheet with a lot of account numbers. I want my Macro to highlight the row A:C if certain accounts are found in the spreadsheet.
For Example:
Account numbers "10998-0000" and "18999-0000" are allowed to be in the spreadsheet so don't want them highlighted. But Account "10110-0000" should be highlighted.
I know the Macro will be big but I was hopping something like: If ActiveCell is not accounts .... I would then list all my account numbers... Then
and at the end a loop until ActiveCell is Empty.
I have this so far.
Range("A12").Select MyColumn = 1 i = 12 Range("A" & i).Select
I have a row range 5:20004. In that row range column R may have 'QLD' in the cell.
I am trying to delete all rows within that range that have QLD in column R or delete the row if R <> 'NSW' (would be a better way just in case there is something other than QLD)
I have students Kg-5th Gr. I need to identify the ones over-aged when I enter the information. The following is what I'm trying to use but I get Y1 for ever cell. I need it to Identify the student as Y1 for One year overage and Y2 for tow years overage.