Find Cell & Insert Rows

Jan 9, 2007

I am trying to find the first "Tour" after cell A138. If "Tour" is not in cell A177, then I want to insert rows until that "Tour" is in cell A177. How can I do this?

Sub InsertRow()
Dim FoundTour As Range
Range("A5").Select
If Range("A30") = "TOUR" Then
Range("A31").Select
Else
Do While Range("A30") <> "TOUR"
Selection.EntireRow.Insert
Loop
End If
Range("A31").Select
If Range("A40") = "TOUR" Then
Range("A41").Select......................

View 6 Replies


ADVERTISEMENT

Find Text And Insert 6 Blank Rows Above It

May 15, 2013

I have spreadsheet with data all over. I want a macro which identifies the first cell (in Column A) which has the text "BNY" and insert 6 blank rows above the text "BNY" (First text in the Column).

Once, it is done - the macro should also assign names to the last inserted row.

Column A - Should reflect "Bank", Column B should reflect "Field1", Column C should reflect "Field 2" and Column D should reflect "Field 3".

And after the names are assigned - It should also highlight the last inserted row in Yellow.

For Example:
Raw Data (Snap):
Bank
Field 1
Field 2
Field 3

JPM
123
456
789

[Code] .....

Output (After Macro):
Bank
Field 1
Field 2
Field 3

JPM
123
456
789

[Code] .......

View 5 Replies View Related

VBA To Find Cell Below The Last Row And Insert SUM

Apr 15, 2013

I am running a macro which basically is a tidy up of a data report that comes from SQL.

I am on the last bit Every time this tidy up runs there will be a different amount of rows but always the same columns. Under the last row of data I want to put the word 'TOTAL' in that row and column J. Then in the same row but column K I want to put a sum of K2 to that last row. How do I do this?

Here's all my code so far - like I said its basic formatiing stuff I've cobbled together!

Sub usagetidyup()
'
' usagetidyup Macro
'
'
Range("1:4,6:7").Select
Range("A6").Activate
Selection.Delete Shift:=xlUp
Columns("H:H").Select

[Code]...

View 9 Replies View Related

Insert Cell Name In FIND Function

Dec 13, 2013

Is it possible to insert a cell refenece into the FIND function.

So, replace JAN-2013 with Sheet1 cell A1

Selection.Find(What:="JAN-2013", After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate

View 3 Replies View Related

Find Cell With Text & Insert Formula Below

Jun 11, 2008

I want the macro to:

1. search A1:AZ1 to find the cell that has the text "VBA Test" in the cell. There could be other text in the cell as well - this is not an exact match - but these two words are the common text.

2. go to that cell

3. go to one cell below that

4. enter a formula (I've got it from here ....)

View 4 Replies View Related

Find Particular Word Then Insert New Entire Column Before Cell

Jan 25, 2014

My worksheet has two sheets which has daily continued data. I want to copy two entire columns E and F from Sheet 1 and then in Sheet 2 I want to find a particular word "80 Percent" and then insert two new Entire columns before that word. And after that I want to paste that copied columns of sheet1 in those newly created columns of sheet 2. Is it really possible because the cell reference of the word "80 Percent" in Sheet 2 will change daily. How to create the macro codes for this.

Find attached file : IRCS1.xlsx‎

View 14 Replies View Related

Macro To Find A Specific Word And Insert Cell

Jan 12, 2010

I have a large spreadsheet with about 18000 rows or data and about 60 columns. I need to a macro to find a specific word in a column like "charge" and anytime that word is found in the column to insert a blank cell in front of it.

Currently the sheet looks like this:Fee AChargeFeeChargeFee AChargeFeeChargeFee AChargeFee AChargeNeed to get it to look like this: (so I can sort and subtotal)Fee AChargeFee AChargeFee AChargeFee ACharge

a macro to the for whichever column I choose.

View 9 Replies View Related

Find Empty Cell In Row After Certain Point Then Insert Values From Another Sheet

Jun 4, 2014

I'm trying to create a macro that when run, scans Row 12 (only after column E), Finds the first empty cell, then inserts the cell value from Sheet4 CellE8. Then the hard bit begins. I need it to insert cell info in all the cells below it, from different locations...

For example

A
B
C
D

[Code].....

In the above sheet, I need it to go to cell D2 and insert the values from Sheet4 CellE8, Then proceed to D3 and insert data from Sheet3 D4, then to cell D5 and insert data from Sheet1 A7, etc etc

I dont mind doing each cell individually, but they will always be in the same column (and row 2 "Value" will always be the one that determines the next empty column).

View 1 Replies View Related

Insert Rows Based On Cell Value

Jun 24, 2014

I'm working on a large table which has one unique product number followed the number of rows that I want to add below it (for other variants of the same product number).

The Data looks like this:

Column B Column C
12543 2
13456 2
19543 1

I want it to look like this:

Column A Column B
12543
12543
12543
13456
13456
13456
19543
19543

View 2 Replies View Related

Insert Rows Based On Value In Cell

May 16, 2011

Want to run a script to add rows beneath each row based on the value in one of the cells in that row and then move to the next row of data and do the same.

For example:

Cell E5 = 7, I want to Insert 7 rows beneath row 5, then move to the next row and insert the number of cells equal to the value in column E of that row.

View 6 Replies View Related

Insert Rows Based On A Value In A Cell

Jul 14, 2009

I need to create a macro that will insert exact number of rows based on the value in certain cell. e.g. value in cell F2 of sheet1 is 3...so I need to insert 3 rows down from cell F9 in sheet2 copying data in cells D9 and E9 to inserted Cells / rows.

View 4 Replies View Related

Insert Blank Cell After Every 10 Rows

Mar 15, 2013

I have in column D 1200 rows of data. I need to insert a blank cell after every 10 rows. Is there a formula or code to do this?

View 9 Replies View Related

Insert Rows At The Active Cell

Aug 7, 2006

I want to be able to allow a user to insert a number of rows (they would specify the number) into a worksheet, at the active cell location. I also need the same number of rows to be inserted into the same worksheet (but much lower down) The location of which is to be governed by the location of the original inserted rows.

Having created the new rows I need all the formulas from the row ABOVE the active cell to be copied into all the newly created rows.

example
If active cell is A5 I want user to be able to run a macro which asks them how many rows they wish to insert. (Assume the user asks for 7).

The macro then inserts that number of rows, (starting at row 5). And additionally adds 7 rows at a location further down the worksheet (say row 105). The formulas from the row above the active cell are then copied into all the newly created rows.

2nd example
If the active cell was A9 then the macro would add 7 rows, starting at row 9 and additionally add 7 rows starting at row 109. Then formulas added.

View 9 Replies View Related

Insert Rows Based On Cell Value

Nov 8, 2006

I need to insert a row based the value of in column L. For example, beginning at L10 and down, are values. These are subtotals that are dynamic (as in they move based on how much data is inputted to the worksheet monthly.) I need to insert a row above the value. So if L22 has (2,961.25) in it, I would like to it down and insert a blank row. So on down the sheet.

View 2 Replies View Related

Insert Number Of Rows Specified In Cell

Feb 7, 2008

I found lots of threads for inserting rows but not the one I need. I'm trying to insert rows with a macro on the position as specified in a cell f.e. in cell D4 I type the number 80 then the macro has to insert three rows at row 80

View 2 Replies View Related

Insert A Blank Rows Based On Cell Value

Aug 26, 2009

I am trying to write a macro which will insert a blank row at the end of each year(A column) (Last cell i.e Dec 95 and so on).

I have attached the file for the same ....

View 13 Replies View Related

Insert Rows According Cell Value In Excel Table

Jun 7, 2013

I need a Module that allowed me when I run it to add Rows down according upper cells Value for Example;

Total
Names

2
Sami

5
Rami

Then after apply the Module I need like this;

Total
Names

2
Sami

[Code] ............

View 4 Replies View Related

Insert Rows Automatically From Value Specified In Reference Cell

Sep 8, 2009

Can anyone help? I need to achieve the following involving the insertion of rows from a specified value reference within the worksheet to which the rows are being added.

The original data would look like:

ABCDEFG1PeterABC, DEF, GHI32DavidABC, DEF23SamABC, DEF, GHI, JKL44TomABC, DEF25

The number of rows to be inserted under each entry is listed in column "C" (which is a count of the separate entries in column "B".

The output data following the application of the "solution" would need to look as follows:

ABCDE1PeterABC, DEF, GHI3ABC2DEF3GHI4DavidABC, DEF2ABC5DEF6SamABC, DEF, GHI, JKL4ABC7DEF8GHI9JKL10TomABC, DEF2ABC11DEF

Where the specified number of rows have been inserted underneath the original entry and the separate values in column "B" have been listed in consequtive cells, relating to their original entry in column "D".

Can anyone suggest code to achieve this outcome?

View 9 Replies View Related

Insert X Rows After Specific Cell Value In Column

Aug 20, 2009

I have a dataset that i want to update, to do this I want to insert 8 rows after each row that has a value in Column C 2000. The set has 600,000 rows, comparing countries (cty, cty2) from 1980-2000. I want to make room for information up till 2008. I see lots of codes for doing this but I will also need help with actually inserting into my spread sheet.

View 3 Replies View Related

Insert Rows & Headings Based On Cell Value

Jan 1, 2007

Inserting Rows and Headings. Is it possible to automatically insert Rows and Headings based on the Cell value of a particular column ? For example column B consists of a field called, 'Assigned Group'. Column A consists of a field called, 'Fault description'. Column A needs to have a heading depending on the value of Column B. One row also needs to be inserted above the heading.

View 6 Replies View Related

Insert Rows Based On Cell Time Value

Feb 9, 2007

I have three columns - "Start Time", "End Time", and "Elapsed Time". Elapsed time is just end time - start time. What I would like to do is insert rows based on elapsed time.

For instance if start time is 6:00 and end time is 6:10, then elapsed time is 0:10. In this case I would like to insert 10 rows below. Basically I want to insert 1 line per minute (based on elapsed time).

View 9 Replies View Related

Insert Multiple Rows Depend On Cell Value Getting Error

Mar 21, 2014

I am trying to add insert rows using macro.

L column fills with numbers. if L1 value is 5 then below need to insert 5 rows.

I tried below Macro.

But it getting Error.

Sub InsertRowswork1()

Dim LastNumber As Long: LastNumber = ActiveSheet.Range("L" & Rows.Count).End(xlUp).Row
While LastNumber >= 2
If Not IsEmpty(ActiveSheet.Range("L" & LastNumber)) Then

[Code] .....

View 6 Replies View Related

Insert Number Of Rows Based On Cell Values?

Feb 20, 2009

Column B contains geographical Areas. Column C contains a list of business departments.

North Env
North Env
North Ops
North Sales
North Sales
North Sales
South Env
South Maint
South Ops
South Sales
South Sales
South Sales

Etc.

The values and number of these departments will vary. I want to insert lines to sum the totals at the bottom of each geographic area based on the number of different departments. So, for this example, for the North three lines would be inserted. For the South, 4 lines would be inserted.

View 4 Replies View Related

Excel 2003 :: Insert Rows Then Format Cell In New Row?

Apr 11, 2013

Excel 2003 / WinXP. I have a list object with 5 columns, A - E, and all cells have a border round them. I need a macro which will:

1. insert a row below the current row (whatever cell happens to be selected)

2. then remove the left hand border of the cell in column B in the new row,

3. then select the adjacent cell in column C in the new row ready for data entry.

Obviously I cannot specify any absolute addresses in the code, and this is where all my attempts to record a suitable macro fall down.

View 7 Replies View Related

Insert Rows & Repeat Values Based On Corresponding Cell Value

Jul 7, 2009

I have a list of 130 names in column A. I have a number value between 0-10 in column B (next to the name). I need to insert the number of rows defined by the value in column B, below each row that I already have (if the value is 0, then the row needs to be deleted). The inserted rows have to be filled with the name value from the row above.

For example - before macro:

Joe Bloggs 2
Adam Wilson 10
Peter Andrews 0
Claire Burrows 6

After macro:

Joe Bloggs
Joe Bloggs
Adam Wilson
Adam Wilson
Adam Wilson
Adam Wilson....................................

View 6 Replies View Related

Insert Extra Rows On Data Based On Values From Another Cell?

Jun 12, 2014

I need to create extra rows of duplicate data. The number of duplicate rows depends on the number of semi-colons in the 15th column (column O).

Sheet 1 is the original working file. Sheet 2 is the result of how the executed macro for the first 2 lines of data. The first line in sheet 1 has 7 semi-colons, so there should be 7 rows of duplicate data created in sheet 2. The second line in sheet 1 has 6 semi-colons, so 6 duplicate lines, etc.

View 3 Replies View Related

Excel 2010 :: Macro To Insert Rows Based On Cell Value Using Button

Nov 10, 2013

I am on office 2010

I am new to VBA programming so i might be making a obvious mistake. I am trying to create a macro that will insert rows depending on a cell value. I also need this to be executed from a command button rather then to occur immediately after the cell value is entered. So as a example

Lets say
Cell A2 has a value 20
Cell A3 has a value 3
Cell A4 has a value 5

when this data is entered and then a Command button poressed there should be

20 rows beneath cell A2
3 rows beneath cell A3
5 rows beneath cell A4

View 9 Replies View Related

Excel 2007 :: Macro To Insert Rows Based On Cell Values

Dec 19, 2013

a macro to insert rows based on certain cell values in column A.

I have uto 300 rows of data. Below is an example of column A.

R1
1
2
3
4
5
6
7

[Code]...

If (above the R) is an 8, I need to insert 2 rows above that R and directly below the 8.

If (above the R) is a 9, I need to insert 1 row above that R below, directly below the 9.

(Below the R there is always a minimum of 8 digits with the 9 and 10 being random).

I have excel 2007

View 5 Replies View Related

Maro, Insert Rows Where Rows Determined By Number Of Carriage Returns

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

Macro To Split Rows Into Groups Of 5 And Insert 3 Blank Rows In Between

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







Copyrights 2005-15 www.BigResource.com, All rights reserved