How To Insert Some Rows On Condition
Apr 21, 2014
I want to get some blank rows in a worksheet after certain characters.i have some data in a sheet. at the end of each cluster of data it ends either with 1-0 or 0-1.
if excel finds 1-0 or 0-1 at the end of a bunch of rows, it should add 5 blank rows under it.then it should search for the next 1-0 or 0-1
If data ends on A25 where you find 1-0 or 0-1 then add 5 blank rows under it from A26:A30,likewise it should be given till it reaches the end of the range.range can be defined as A1:A1000
View 4 Replies
ADVERTISEMENT
Mar 8, 2008
I deleted the data and made up some figures but kept the format to protect privacy. Highlighted blue and green because it's possible to have the same name have 2 different types. I put in dashed lines to more clearly divide months.
1. For each UNIQUE "Name" and "Type" add a new row starting from last entry
2. Copy A,B,C to new row
3. Copy LAST (most recent) "End Balance" from column "I" corresponding to last person
4. Copy column "I" formula into new role
So Name, ID#, type, column D and the formula in "I" (excluding "Name" and "Type" duplicates) should be added to the end of the sheet with their new row
Unsure if possible:
5. Make old amounts (columns D,F,H,I) not count towards the totals
6. Totals reflect new amounts only so values aren't counted multiple times
exampleforforum.xls
View 2 Replies
View Related
Feb 28, 2007
I have a workbook with about 8 sheets that is used for pricing vehicles with options.
On the first sheet is the list of about 40 vehicles. I would like to insert a command that IF the quantity of vehicle X = 1 (all others would be blank) then insert a MS Word document that contains the proposal.
The MS Word document could be a worksheet if necessary.
View 14 Replies
View Related
Aug 12, 2009
I would like to write a code, that can check the name of cell A1 with A2.
If A1=A2, then insert a blank row between these two rows.
I have started with a loop, but somehow it does not work.
Sub AddRows ()
Dim Row As Long
For Row = 1 To 3800
If Cells(Row, 1).Value = Cells(Row + 1, 1) Then
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next Row
End Sub
View 9 Replies
View Related
Apr 4, 2014
I need a macro I can run that will insert a row whenever Column A changes (from PPN A to PPN B to PPN C, etc.) and that will insert string values into the Cells as follows:
In all cases, the insert cell values into column A (PPN) will be the value from the previous cell and column B (CPN) will be 'LABOR'
Here's image of before and desired after:
Before:
PPNCPN
4AQ02SLAG
4AQ02SAND
4AQ02CHIPS
4AQ02PORTLAND
4AQ02ADMIX
4AQ02AUTUMN BLEND
4AQ02OVERHEAD
4AQ03SLAG
4AQ03SAND
4AQ03CHIPS
4AQ03PORTLAND
4AQ03ADMIX
4AQ03BETHEL BLEND
4AQ03OVERHEAD
After:
PPN CPN
4AQ02SLAG
4AQ02SAND
4AQ02CHIPS
4AQ02PORTLAND
4AQ02ADMIX
4AQ02AUTUMN BLEND
4AQ02OVERHEAD
4AQ02LABOR -insert row and populate cells here
4AQ03SLAG
4AQ03SAND
4AQ03CHIPS
4AQ03PORTLAND
4AQ03ADMIX
4AQ03BETHEL BLEND
4AQ03OVERHEAD
4AQ03LABOR -insert row and populate cells here
View 1 Replies
View Related
Feb 5, 2007
I have made really huge downloads out of our SAP system (needed over 20 separate Excel files ;-). I need to analayze the data, but unfortunately the date is not 100% consistent as some cells are emtpy. Is it possible to have Excel look down a column, and have it insert a blank cell in another column on the same row where it found the empty cell? (and move the cells right a a result?)
I have attached an example of what Excel should do as it is hard to explain (as you can tell ;-). I am likely to spend the next days figuring out how I can best combine the data and analyze it!
View 2 Replies
View Related
Jun 21, 2008
I have an imported report in a spreadsheet. It imports to three columns. I need to check each row in column A for three seperate criteria and delete the rows I don't need. I need to delete blank rows and check next row for page header info. Delete these and next rows to next blank cell. Check next row for page header and not delete if not page header. Several rows down will be a cell with 23 blank spaces before the word Reg: and sometimes other words past this but always this first. This row is to be kept. I looked at the FAQ's example of Deleting but I don't think it will work. I also need to put a key word in column A at a point where I want to stop. This report is a couple thousand rows long so a VBA procedure would really save time. I have a procedure I use to check for two zero's in two cells that hide these rows but I couldn't modify it to work on this report.
View 9 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
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
Sep 25, 2012
I would like an easy/fast way cut an entire row of data from one worksheet ("Open Work") to another ("Closed Work"). Each worksheet has a matching Header Row from column A - N. In "Open Work" I have column "K" with various values, but I'm looking specifically for the "CLOSED" value. If a cell in column "K" = CLOSED, I want to cut the entire row and paste it into the other worksheet "Closed Work".
That was a no-go! It copied limited rows AND duplicated them.
VB:
Sub copyrows()
Dim tfCol As Range, Cell As Object
Set tfCol = Range("A2:A9") 'Substitute with the range which includes your True/False values
For Each Cell In tfCol
[Code] ......
View 6 Replies
View Related
Apr 10, 2014
I have an excel file with thousands of rows and I'm trying to pull certain data from one tab to another. In the example, I want to pull all Listings that are "Open" (I know, just filter), but if the listing is "Open" I want to pull all of the other statuses it once had as well in the new tab. Notice how a listing can have multiple statuses.
I was thinking I could filter by Status (Open) and then do a vlookup (using the listing number as the lookup number), but it doesn't work.
View 4 Replies
View Related
Oct 6, 2008
I'm working this spreadsheet and i want to automate of deleting the entire rows once the last two columns contains both Zero values. the worksheet cotains thousands of row to clean-up.
View 3 Replies
View Related
Dec 15, 2009
I want a macro to delete the entire row based on the value in Column Q ....
View 14 Replies
View Related
Jan 18, 2012
I have data in the format below. I'm looking for a piece of code that will look down column B and if there are 30 rows in which all the values are zero then delete all rows from row 1 to the last row of those 30 rows.
Input_data AB106/01/2012 13:03:170206/01/2012 13:03:1816306/01/2012 13:03:1916406/01/2012 13:03:2016506/01/2012 13:03:2117606/01/2012 13:03:2224706/01/2012 13:03:2316806/01/2012 13:03:240906/01/2012 13:03:259.51006/01/2012 13:03:26191106/01/2012 13:03:27211206/01/2012 13:03:28161306/01/2012 13:03:2981406/01/2012 13:03:3001506/01/2012 13:03:31571606/01/2012 13:03:32801706/01/2012 13:03:331091806/01/2012 13:03:341331906/01/2012 13:03:35156
View 1 Replies
View Related
Nov 2, 2007
I need macro to perform the following steps. I have also enclosed the image of the file for reference.
1)I need to move or copy the data in sheet one to sheet two.
2) In sheet two I need to select customer BBBB and delete all the rows beginning with PO# of 17, 18, 46 or GL4.
3) finally I want to delete all the rows in the sheet which are not equal to class Invoice. (Presently I do this using custom filter as "doesnot equal" = Invoice") ..
View 11 Replies
View Related
Mar 21, 2007
Currently i have this to delete entire rows that have cells which contain any words with "Security Market" in it.
How can i extend this to include many more variables like e.g. " Total" "ABC" "XXXX"
Dim rag As Range 'Rows with "Security Market"
Dim sec As String
sec = "Security Market"
Do
Set rag = ActiveSheet.UsedRange. Find(sec)
If rag Is Nothing Then
Exit Do
Else
Rows(rag.Row).Delete
End If
Loop
View 5 Replies
View Related
Feb 16, 2014
how can I write a routine to add rows in one Sheet if a condition which involves a different Sheet is met (excel 2007).
In Sheet 1 is a list of ("liquid") names (cells C4:C26) which will need to be expanded should the IF condition be satisfied. In row 27 I have a subtotal (whihc is using data from columns D onwards), and from row 29 down cells are not empty.
The condition I want to verify is in Sheet 4-column I, where it is reported whether a name is classified as "liquid" or "illiquid". If the number of "liquid" names in sheet4-column I is more than the number of names in Sheet1-C4:C26 I would like to add as many rows as the difference between the two lists. Also I would like to make sure that the subtotals that I have in row 27 (and that will be shifted down when new rows are added) will also inlcude the data in the new rows (the subtotal is taking data from columns D onwards).
Should the code need to inlcude the name of the tabs, Sheet 1 is called Summary and Sheet 4 CDS Data.
View 1 Replies
View Related
Feb 6, 2009
I've got a workbook (attached) with a "summary" sheet & 2 detail sheets for tracking vacation time used, and I need to make it automatically clear out an employee's "used" vacation hours automatically on their anniversary date.
Can anybody help me please? I've had no luck thus far & "the powers that be" are really getting on me for this now -
View 14 Replies
View Related
May 28, 2009
What I need is a macro to delete a row or rows for a specific range of cells (eg. E20 to E58) when the cells in that range column E is = blank. The cells in column E is formated with a currency sign $. Deleting the row should shift up all rows below. I need to run this macro manually. Excel 2002 SP3.
View 9 Replies
View Related
Jul 20, 2009
Is it posibile to make a macro that automaticaly delete rows based ona a condition. Condition is to delete rows that have B column value "" or zero. For example:....
View 12 Replies
View Related
Aug 8, 2012
I have a data dump. I download everyday with 200 rows and 20 columns. I need to remove any rows where there is no value in either columns C or D. Is there a quick way to do this?
View 7 Replies
View Related
Nov 5, 2012
How to create a macro that would highlight a row that has the following condition :
name
ref num
sam
123456
sam
123456
alice
342333
In this table, i need a macro that would highlight the row that has alice data due to it been having 1 ref number count under the ref num column. The macro should loop and end with msg " there are 'x' records having 1 ref number count"
View 1 Replies
View Related
Feb 11, 2013
I have a cell with today's date on it. i.e., cell A1 = today()
Then, I have rows of data with one of the columns with a date on it. I've put in an object (button), where when the user presses this button, I want all the rows of data that do not have the date on cell A1 to be hidden.
Then on the second button, when the user presses the button, to unhide all the rows that were previously hidden. To make it easier, I can simply state it to unhide all the previously hidden rows (but NOT columns - there are still hidden columns which I want it to stay hidden).
So in sum, using table below. If I have on cell A1 - today's date is 2 Mar 2013, pressing first button would hide the row with Jane Y's record. Then pressing second button would then unhide all previously hidden rows.
DATE
NAME
DEPT
1 Mar 2013
John X
Accounting
2 Mar 2013
Jane Y
Operations
3 Mar 2013
Joe Z
Marketing
How can I accomplish this?
View 6 Replies
View Related
Mar 12, 2002
I haven't mucked about with Excel in quite a while now and have been asked to do a module in Excel 2000.
When given a workbook (tej-exit.xls) which has one worksheet of thousands of rows with columns from A to AS, i would like to copy all rows which have a zero in column N to a new worksheet.
Is this difficult?
Would i have to have one workbook with the code module in, load up the tej-exit.xls file ?
View 9 Replies
View Related
Jan 6, 2009
I want to create a macro the will delete all the rows in a sheet if 1 of 2 conditions are met. The first condition is if a cell is blank or if a cell contains the word "negative"
View 9 Replies
View Related
Nov 1, 2006
how to delete duplicate rows except the first and the last rows using macro..
I have data like this and i want to delete those rows except the first and the last rows
31/10/2006
31/10/2006
31/10/2006
31/10/2006
I use the below macros from btadams posted 27th January 2003 but only for delete the last row
Sub DleteDups()
Dim Cell As Range
Do While ActiveCell.Offset(1, 0) <> ""
If ActiveCell.Value <> ActiveCell.Offset(1, 0).Value Then
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.EntireRow.Delete
End If
Loop
End Sub
View 9 Replies
View Related