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
ADVERTISEMENT
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
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
Jul 30, 2013
Is there a way to insert a specified number of rows. For example, I want to insert 500 blank rows today but maybe tomorrow it will be 650 blank rows.
View 1 Replies
View Related
Dec 29, 2008
My first sheet shows the data - a list of audits and their current status.
AuditStageAlphaIn ProgressBetaReportingCharlieCompleteDeltaCompleteOmegaPlanning
I've then used a simple count formula to add up the number by each stage and it's these numbers that I want the macro to use when determining how many rows to input.
Complete2Reporting1In Progress1Planning1
A second worksheet hosts the desired output - a simple report template, split into stages for each status type (completed, planning etc.) with the correct number of rows for each.
Completed AuditsCharlieDeltaReportingBetaAudits in ProgressAlphaAudits in PlanningOmega
So, I want the macro to ensure that we have the right number of rows for each stage, as this month will be run on a monthly basis and the stage each audit is at will change, and the number of rows required in each section will also be different.
View 9 Replies
View Related
Jan 31, 2008
I have a spreadsheet which contains data needing to be re-formatted into a suitable format for my database. So far I have been doing this by hand, but want to make it quicker as I have over 2000 lines to sort out. I am trying to write a macro that determines whether there is data in the column next to the active one (D2), and if there is counts how many columns there is data in. Once it has done this it needs to insert the same number of rows as there are columns, then copy the column data and transpose it into the empty rows. My macro seems to work at first, but it exits after around the 4th row, but I can't work out why.
Sub split_For_Database()
Dim No_Of_Cells As Integer
Dim Start_Cell As Range
Dim Cell As Range
Dim LastRow As Range
Dim i As Integer
Dim lRows As Long
Set LastRow = Range("C65536").End(xlUp)
i = 0
Set Start_Cell = Range("C2")
Set Cell = Start_Cell
Do While Start_Cell.Address <= LastRow.Address
Do While Cell.Offset(0, 1) > 0
i = i + 1
Set Cell = Cell.Offset(0, 1)
Loop...................................
View 8 Replies
View Related
Apr 23, 2014
I have an excel sheet that I've automated for my shop ... Basically it copies a set of rows from one sheet, asks for which cell you want to start the paste at, then pastes it... Here's what I have so far:
[Code] .....
So I tried to use a variation of strReturn to indicate number of rows wanted but that didn't work ... Basically I'm going to create the "data" to include 50 rows, but have it selectable for the user to say they only want 5, 7 or 29 rows ...
View 2 Replies
View Related
Feb 11, 2014
Original
01012014 DAVE JOHN
02012014 MAT
03012014 CHRIS MIKE PHIL
What I want
01012014 DAVE
01012014 JOHN
02012014 MAT
03012014 CHRIS
03012014 MIKE
03012014 PHIL
View 4 Replies
View Related
Apr 8, 2014
I am trying to insert formulas to my cells in different columns and then fill down the formulas as many rows as in the reference column. So far I have put my formulas in a macro but I seem to get problems with " and ' symbols. My macro looks like this:
Sheets("Sold Articles Database").Select
Range("U3").Formula = " =VLOOKUP(LEFT(K3,2),'Input Variables'!$A$48:$B$52,2,FALSE)"
Range("V3").Formula = " =VLOOKUP(K3,'Product datas'!$A$2:$C$10000,3,FALSE)"
Range("W3").Formula = " =VLOOKUP(K3,'Product datas'!$A$2:$D$10000,4,FALSE)"
[Code] ........
View 3 Replies
View Related
May 2, 2007
I need this for a tracking sheet of scores. For example, 1 gets 100 points, 2 gets 90 points, 3 gets 80 points, etc. I need to set it up for 10 places. I have no idea and have fiddled with it for two hours now. I need to be able to put a 1 in the cell and 100 appears after I hit enter, etc.
View 5 Replies
View Related
Dec 6, 2013
I am looking to insert a date in a Cell when another Cell's number has been changed.
I was using If statement as: If(isnumber(f4),TODAY())
but I don't think it is working properly
the cells columns would be, e.g. "Consumables stock" and "date updated".
So if someone changes a number is the "consumables stock" column, date updated column auto-updates with current date. How would I go by in doing this?
View 5 Replies
View Related
Jun 7, 2014
I am looking for a formula which will insert a word into cell A3 depending on the number in cell A2. For example A2 is between:
0 - 10 then insert the word Div 1
11 -17 then insert the word Div 2
18 - 23 then insert the word Div 3
24 28 then insert the word Div 4
View 4 Replies
View Related
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
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
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
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
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
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
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
View Related
Aug 8, 2009
On the attached Excel file, I have code that will insert a variable number of rows and copy and paste from and to variable positions. That all works fine when run from a command button, but when I try to run it from the Worksheet_Calculate by entering 1 in J1 or K1 (inrange cell is J1+K1 for testing purposes) the CommandButton1_Click sub runs continously until an error occurs.
View 4 Replies
View Related
Oct 3, 2008
Need a function that would insert a letter or a number in front of numbers in a cell for example
column A
3245
I want to insert the prefix "S" in front of the nummbers 3245. so i would hopefully end up with
Column A
S3245
View 3 Replies
View Related
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
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
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
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
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
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
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
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
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