Insert Rows By Criteria
Nov 20, 2007
i need a macro for inserting a row in sheet by criteria. the Criteria:
1-checking if Collumn G ( letters ) are equal
if not then inserting the row
2-cheking if collumn H ( numbers ) are equal
if not then inserting the row
one more thing i need the row to be yellow from collumn B .. to .. I
View 4 Replies
ADVERTISEMENT
Feb 3, 2009
I need to insert one or two rows depending on the criteria of two different columns.
We have two shops (A and B)...and the sales are expresed like this: ....
View 9 Replies
View Related
Mar 12, 2007
There are many columns in Sheet1 and more will be added for titles of the columns remains unchanged. One of the Col. in Sheet1 is 'Part Number'. Part Numbers are defined as 'Configurations', and each Configurations has additional parts and peices which are broken down in Sheet2. Back in Sheet1, I also have a Col. for QTY. So, if Sheeet1 has a part number that matches in Sheet2, then I would like Excel to copy all 'parts and pieces' and QTY from Sheet2 to Sheet1. Please make sure that I want the QTY to be multiplied if applies. Please see below for an example:
Sheet1 looks like this:...................
View 2 Replies
View Related
Apr 26, 2008
I have three worksheets that I am combining into one master worksheet. The data from Worksheets 1 & 2 are listed combined under the same headings onto the master worksheet. I have three additional headings on the master that need to populate information from Worksheet 3 under them. I would use VLOOKUP to populate those fields if it weren't for the problem that some asset numbers have more than one entry. The request I received is to insert copy the criteria row below it so that there are an equal number of entries for each occurance of information from Worksheet 3 to copy that data to.
(example = Asset 12345 has 3 different work orders on Worksheet 3, therefore I have three rows for Asset 12345 on the master with the data I need copied under the 3 headings.)
To figure out how many rows to insert I created a last column (that I will delete at the end of the macro) that uses COUNTIF to count the number of occurences of the asset number on Worksheet 3. I want my macro to look down this column and for every value over 1 add rows equal to that value-1 beneath the row. I then need to copy the information from the criteria row into the newly inserted rows. I will need to figure out how to populate the data from worksheet 3.
I tried recording a macro of me using FIND >1 values while selecting the column containing criteria and it didn't work because it likely was literally looking for ">1".
View 4 Replies
View Related
Feb 17, 2010
The best way to explain my problem is to look at the table below:
How it looks now: ApplePrice 1
Price 2
Price 3FruitDeliciousPearStore 1
Store 2FruitVery DeliciousHow I want it to look:ApplePrice 1FruitDeliciousApplePrice 2FruitDeliciousApplePrice 3FruitDeliciousPearStore 1FruitVery DeliciousPearStore 2FruitVery Delicious
View 9 Replies
View Related
Feb 9, 2013
I would like to have my macro code search column A (supplier numbers) and split the rows into groups of rows of 5 or less and then insert 3 blank rows between each group of rows. The split needs to start on a new supplier number and cannot split a supplier number into two different groups. Here is a sample:
Supplier
Invoice Date
GL Date
Invoice Amt
[Code].....
View 1 Replies
View Related
Oct 30, 2013
I have a spread sheet with values in the area of A1:H834
In column H, I have number values from 1-7.
Essentially that number value means that the values in the row are duplicate.
So, for example, if H2 has a value of 4, that means that $A$2:$G$2, really should have an additional 3 rows underneath with the EXACT same data in each cell, however, the way the sheet was created, was to remove the duplicate values and just indicate in column H, the number value of how many duplicates $A$2:$G$2 really is.
I need to unpackage this and create what it was originally. What type of formula can I use, to look at the value in H2, and then insert underneath that number of rowes with the exact same data as A2:G2 and do the same for the remainder of the table all the way down to A834:G834
View 1 Replies
View Related
Mar 15, 2014
I'm a macro novice and have been trying to teach myself how to write the correct one for a task I need to do, but I cannot seem to get it right. Basically, I have bunch of data and for one of the variables, different values are separated by commas. What I want is to create a row copying the info below for each piece of data after the comma.
Sheet1
A
B
C
D
[Code].....
I suspect there is a fairly easy way to do this, but I cannot figure it out from searching the forums (or rather, I can't get it to work right).
View 6 Replies
View Related
Jun 26, 2014
i have this code which inserts blank rows in alternate rows,
Code:
Sub insertrow()
' insertrow Macro
Application.ScreenUpdating = True
Dim count As Integer
Dim X As Integer
For count = 1 To 20
If activecell.Value "" Then
activecell.Offset(1, 0).Select
[code].....
what changes should i make in this code to insert rows only when ther are now blank rows. So first time i run, blank rows are already there, and when i update some data at the bottom and re-run it inserts blank rows again.
View 3 Replies
View Related
Apr 15, 2009
I have a spreadsheet detailing account numbers (there are more than 1 of the same account number) that I currently filter by text (contains) and an additional filter to sort from A to Z
What I would like for my next step (I am looking to create this as a macro) is insert a row when one account number stops and another starts
eg:
A/C
SS501
SS501
SS501
SS503
SS503
SS503
I would like it to read
SS501
SS501
SS501
SS503
SS503
SS503
etc.. Without having to insert row manually.
View 9 Replies
View Related
Dec 6, 2013
I have a table with 3 columns with an unkown number of rows (text, date, date) that is being imported daily.
I want to create a 4th column with dates starting from today and each subsequent row be one day earlier. I want to look at 30 previous days.
I then want to count the number of rows (looking at column 1-3) with the following criteria:
Countif column2<= "date in colum4" AND column3< "date in column4"
View 6 Replies
View Related
Sep 22, 2009
Here is what I have. 4 Worksheets. The first worksheet is a summary page. I have 350 personnel that are broken down into three different groups. So each group has it's own sheet. Here is what I need to accomplish. Results need to be posted on the summary sheet.
I need to compare cells B2 & D3 for each row on a worksheet and display the number of times they match on a worksheet. For example how many times does EP & EP match on a certain row. I need to compare cells B2 & D3 for each row on a worksheeet and display the number of times they don't match on a worksheet. For example how many times does EP & MP occur. I've attached an example for reference
View 5 Replies
View Related
Apr 27, 2014
I need a simple VB Code which will check the vale in cell A11 in a closed workbook.
If A11=Lunch insert a blank row otherwise do nothing
View 3 Replies
View Related
Apr 21, 2009
I have a sheet of around 5000 rows, I would like a macro to do some manual work for me.
Is it possible for a macro to insert a row if a "1" is present in column I. If possible I would like the row to be inserted above the 1.
View 9 Replies
View Related
Jun 21, 2008
as per the attached, need to insert those grey rows subject to the following condition :
if current row date <> next row date, .and. current row latitude / longitude <> next row latitude / longitude , insert grey row with date = current row date, else insert grey row next row date
note that the coordinates in the repeated grey rows, for the "Home" location, are the same through the sheet, should be entered by the user, at the beginning of the process, since there will be a spreasheet per user.
date is in column K
latitude / longitude are in columns B / C
this will be of tremendous assistance in automating mileage claim review.
View 8 Replies
View Related
Jan 29, 2009
I'm trying to create a macro that takes data from one row and inserts it into a new row. Attached is a workbook with a before and after example of what I'm trying to do.
Each row has a security transaction that includes principal cash and interest. The data needs to be formatted so that each transaction has one row for principal and one row for interest.
Principal is identified by the tran code PAYDOWN in column C. Interest is identified by the tran code INT. However, the raw data generated includes both interest and principal under the tran code PAYDOWN.
There could be 100 or 1000 transactions generated based on the day.
View 2 Replies
View Related
Jan 22, 2014
I have data in cells B2:E2 and this can go down 100+ rows.
In column B i have invoice numbers but some cells contain the word "Deposit".
I have sorted this data so that the invoice numbers appear first and then all the Deposits.
I need a code to find the first instance of the word "Deposit" and to insert a row so that all the invoices and Deposits are seperated by a single row.
View 4 Replies
View Related
Apr 1, 2014
I will have a list of unique values. For each unique value, there is an indicator that tells me how many lines of information I need. Based on that criteria, I need a macro to insert that many rows and populate it with text. This will ultimately become a look up table that I will just use index/match function to populate.
I've attached a sample sheet. I'm not sure if I need a macro to insert rows or a macro to paste a copied range. Or maybe I need a mixture of both with a formula to calculate the number of cells I need?
View 9 Replies
View Related
Apr 10, 2014
For my thesis dataset I am looking to insert two rows after every six rows (the company name) in a dataset with approximately 30,000 rows.
For the first extra row that would be cell 4/cel6
For the second row that would be cell 5/cel6
A picture is added below in which I have manually entered these formula. Is there any way to make this a swift operation rather then a manual one?
untitled.JPG
View 1 Replies
View Related
Jan 10, 2010
I want to achieve is a procedure that inserts horizontal page breaks at certain parts of the sheet where there is a cell equal to 2. Here is the code I have so far.
Sub insert_pagebreak()
Dim printbreak_cell As Range
Dim j As Long
Dim i As Long
ActiveSheet.ResetAllPageBreaks
Set printbreak_cell = Range("AD1")
j = 1
For i = 1 To 100
If printbreak_cell.Value = 2 Then
Set ActiveSheet.HPageBreaks(j).Location = printbreak_cell
j = j + 1
End If
Set printbreak_cell = printbreak_cell.Offset(1, 0)
Next i
End Sub
Everything works until the cell value reaches a 2, and then once it goes into the If statement I get a 'Application-defined or object-defined error' at the below line.
Set ActiveSheet.HPageBreaks(j).Location = printbreak_cell.............
View 3 Replies
View Related
Aug 28, 2007
I have a worksheet in which I have sorted the data based in date and numbering (column I and E). I would like to create 2 macros for following actions:
1- all rows with the value "TOM" in column C will have to be deleted.
2- all rows with a value of 601 or 602 in column E, will have to be moved to the bottom of the sheet after the last row with data. The rows that have been moved will have to be sorted based in date (column I) and numbering (column E).
View 2 Replies
View Related
Mar 12, 2007
Is there a way to have a sort of programmed button that could be pressed that would insert all of the rows at once? Or perhaps a new line could be generated for each table with the only missing data being the values that would have to input manually?
To make it more clear I have attached a sample table. In the sample table, what I would want to do is insert a row at row 47 and at row 93. I want to do these at the same time easily. Keeping in mind that there are 40 some other tables arranged in series like that in one single spreadsheet. I cannot simply hit ctrl and select the two rows and then insert both rows, this would be equally as time consuming to do for all of the rows that would have to be added. Also, in the attached table, most of the values are either calculated values or are hard set numbers. The manually inputted values occur in columns B, E, and F. Everything else is copied down from the previous line.
View 9 Replies
View Related
Oct 31, 2008
Why is my code below doesn't work on Book2. The code is on Book1. If I'm on Book2 and run the macro, it applies the macro on Book1 and not Book2.
View 4 Replies
View Related
Jan 21, 2009
I have file which is repeating, and i want to insert a row after the end of each repitition.
here is my sample data from:
123sat
123sat
444mat
444mat
444mat
555abi
to:
123sat
123sat
new row insert
444mat
444mat
444mat
new row insert
555abi
I know it involves a macro and i dont know how. pls help as its a HUGE data and i need to automate it.
View 12 Replies
View Related
Aug 27, 2003
How to add a row in a spreadsheet every say 5th row OR add a row whenever a specific string or value is found?
View 9 Replies
View Related
May 13, 2013
I am wanting to insert a new row after every 6th row in a spreadsheet that contains in column A of each new row the text xxxx.
View 2 Replies
View Related
Jun 17, 2008
I had fix my rows is from 1 to 100,and each ten rows consists as one row and I had use border to separate each ten rows.(Eg,row 1 to 10 is 1row).....So when I click a button and I choose to add 10rows after row 20,how can I do so? because when i choose to add 10rows after row 20,the existing row start from 21 will move down....But the problem is I had fix my rows to 100 only...How can I do so that the row 21 will move down and at the same time check the total of rows will not exceed 100?
View 9 Replies
View Related
Oct 27, 2009
I need to insert 2 blank rows within a spreadsheet above certain other rows that contains data that starts with a particular text string.
Details:
Column A has office codes in the form of "0301A", "0301B", etc.
Column F will have billing codes that could start with either "L" or "ND" or "NF".
Problem:
I want to separate the L's from the ND's and also the NF's in column F based on which office they are billed to.
End result:
What I want to end up with are two blank rows in between each office code in column A, then another two blank rows between the L's, ND's and NF's.
View 9 Replies
View Related
Aug 27, 2003
I know this has been asked a million and 1 times, but I can't seem to find any history of it.
Does anyone know how to add a row in a spreadsheet every say 5th row OR add a row whenever a specific string or value is found?
View 9 Replies
View Related
Mar 5, 2008
This sheet has A:K columns and 1:3212 rows. There are 'page headers' that are in the text file that I want to delete (the text file was exported from an AS400 program). The first row that starts the page header has SA341 in column 1. Each page header has 5 rows. I used this code from one of the other threads on deleting rows, but I obviously do not understand the code as it deleted all rows that contained SA341.
Sub DeleteRows()
Column_To_Check = 1
Start_Row = 1
End_Row = ActiveSheet. Cells(Rows.Count, Column_To_Check).End(xlUp).Row
MsgBox End_Row
Search_String = "SA341"
For Row_Counter = End_Row To Start_Row Step -1
If ActiveSheet.Cells(Row_Counter, Column_To_Check).Value < SA341 > Search_String Then
ActiveSheet.Rows(Row_Counter).Delete
End If
Next Row_Counter
End Sub
View 9 Replies
View Related