Adding Multiple Rows With A Macro

Feb 23, 2010

I´ve made a simple macro in order to make easier to add new rows in a table, by filling the cells with the new data.

The problem is that according to one of the fields, I´d like that macro to add multiple rows, with exactly the same information but numbering all these rows on this specific field from 1to the number I filled on the respective cell.

For example, I have beyond another fields that I´ve already filled, the field "Parcel" and "Total of Parcels". I filled parcel with number 1 and total of parcels with 5. Then I´d like the macro to add 5 rows with the "total of parcels" cells containing 5 on every row and the field parcel filled with number 1, 2, 3, 4 and 5, for each row created.

View 14 Replies


ADVERTISEMENT

Formula For Adding 12.5% Onto Multiple Rows?

Apr 25, 2014

I have a quotation that I am working on that I need to add 12.5% onto each seperate line price.

There are 300 individual lines on the quote all with different pricing but they all need 12.5% adding on so I am hoping there is a simple way to do a bulk sum for all of the rows rather than having to go through each row and creating a sum for each. - ie =(K28*1.125)

View 3 Replies View Related

Adding And Deleting Multiple Rows

Jul 9, 2013

I have a spreadsheet with multiple similar entries I would like to add up. What would work well for me is to be able to input a column like a and a target column like e.

So in this case it would search throughout column a and wherever it finds a duplicate entry add column e and then delete one of the rows. I could then run it again under different column criteria if needed.

So if I had the below sheet:

I could search by column a and add up column h to read like this:

View 1 Replies View Related

Adding Multiple Rows Of Text In A Msgbox.!

Oct 7, 2009

I believe this would be a very simple query for some but I am a complete novice in VBa and am using a msgbox in one of my file but I need to split the message text into multiple lines but I do not know how to do the same.

View 6 Replies View Related

Adding Multiple Rows Using Insert Copied Cells Function?

Feb 26, 2013

I have a spreadsheet with 27 Columns and 439 rows of data. I need to copy each row of data that has a certain criteria and paste the same data 141 times below it and then manipulate the data. In the same spreadsheet I need to copy a row of data that has other criteria in it and past it 30 times below it, and then manipulate the data.

I have been using the copy and insert copied cells function, but I have to scroll down 141 or 30 rows each time to ensure I add in the correct amount of rows. Is there a more productive way to do this? I have about 10 workbooks with approximately 47 tabs/worksheets each that I will need to update in a similar fashion.

View 4 Replies View Related

Adding Rows And Calculation To Macro

Nov 3, 2008

I am extending rows on a salary schedule. As you can see below, the rows include: Bargaining Unit (GP) Schedule(2A) Range(5) Step (A) Hourly (S) and the hourly wage(11.52)

GP,2A,5,A,H,11.52
GP,2A,5,B,H,11.82
GP,2A,5,C,H,12.17
GP,2A,5,D,H,12.5
GP,2A,5,E,H,12.88
GP,2A,5,F,H,13.22
GP,2A,5,G,H,13.61
GP,2A,5,J,H,14.18
GP,2A,5,K,H,14.71
GP,2A,5,L,H,15.26
GP,2A,5,M,H,15.83

The Steps currently go from A thru M but I need to add N thru Z and after step M there is a 3.75% increase for each step.

You can see that this is a csv file (comma delimited). All of the other info needs to autofill and only the new steps (N-Z) will change and the wage for each of the new steps. The last row is 2 decimal points.

View 8 Replies View Related

Macro For Inserting Rows After Every Nth Row And Adding Text To Inserted Row?

May 26, 2014

I have the macro to insert rows every nth row, but need to be able to insert text into that nth row.

I have a list of addresses and every 10 addresses i need to insert a 'seed' which will be have the same details everytime. This is what i have so far...

Sub InsertRowsMod10()
Dim r As Long
r = 10
Do Until Len(Cells(r, 1)) = 0
Rows(r).Insert Shift:=xlDown
r = r + 10
Loop
End Sub

View 2 Replies View Related

Macro Code Hangs/Freezes Adding Rows

Sep 15, 2006

I've managed to use some code I found to add a new row below the selected row, and duplicate all the forumlas of the source row. It worked fine dozens of times yesterday, but today it's decided not to work. It gets as far as creating the new row(s), but then just hangs & excel crashes before duplicating the formulas. I've even tried reverting to an earlier version, which also worked fine, but this crashes also!

Sub Add_New_Row()
' Unlock Worksheet
Worksheets("Sheet1").Unprotect Password:="*****"
Dim x As Long
ActiveCell.EntireRow.Select 'So you do not have to preselect entire row
If vRows = 0 Then
vRows = Application.InputBox(prompt:= _
"How many rows do you want to add?", Title:="Add Rows", _
Default:=1, Type:=1) 'Default for 1 row, type 1 is number
If vRows = False Then Exit Sub
End If
'if you just want to add cells and not entire rows
'then delete ".EntireRow" in the following line
Dim sht As Worksheet, shts() As String, i As Integer
Redim shts(1 To Worksheets.Application. ActiveWorkbook. _
Windows(1).SelectedSheets.Count)..................................

View 7 Replies View Related

Excel 2007 :: Adding And Deleting Rows With Hide Row Macro CheckBox?

Mar 18, 2014

I currently have the following Macro for one of my many checkboxes in 2007 Excel:

[Code] .....

It works perfectly until additional rows are added/deleted before the indicated rows in the code (It changes the number sequence in the workbook). The number sequence stays the same in the code which means I am now hiding rows either before (delete rows) or after (insert rows) the intended rows I want to be hidden. Is there a way to change the above code to remain with the assigned rows regardless of the adding/deleting of rows before it?

View 1 Replies View Related

Macro To Delete If Set Of Multiple Rows Equals Another Set Of Rows

May 10, 2012

I need a macro that can look at multiple (say three) rows and delete those rows if they match another three rows in the worksheet.

For example:

1 0
3 1
5 7
4 4
6 5
8 3
1 8
5 2
3 9
6 5
8 3
1 8
7 5

If three rows are the same, then one set is deleted (it can be either bottom or top set). I would like to do this for rows 1-500 in the worksheet.

View 1 Replies View Related

Macro - Inserting Multiple Rows

Feb 23, 2009

see the attachment. You will see that I have recorded two macros:

1) To insert a new row for new people.
2) To insert a row for new animals.

With regards to 1), I would like to create a macro that copies the contents of the row with the penultimate name in the people section, and for a new row to be inserted beneath the copied cell. Similarly, with regards to 2) I would like to create a macro that copies the contents of the row with the penultimate name in the animal section, and for a new row to be inserted beneath the copied cell.

The issue that I have is that the macros do not copy the penultimate cell in each section, but copy a particular row, say row 11 each time I want to insert a new animal. So if I had inserted numerous new rows for the people section, and subsequently wanted to insert a new row for the animal section, I press “crtl+sht+a” which copies the contents of row 11 and which is not the contents of the penultimate row for the animal section.

View 2 Replies View Related

Macro For Copying Multiple Rows

Feb 11, 2010

I'm trying to copy multiple rows with a macro. Below code lets me duplicate one row at the time and the duplicate is inserted just below the chosen row.

View 2 Replies View Related

Macro For Merging Multiple Rows To One Row

Aug 19, 2013

number
string
string
string

date

string
string
date

string
string
string

string
string

string

View 9 Replies View Related

Macro To Delete Rows Containing Multiple Criteria?

Feb 23, 2011

how they can be used to delete rows that meet multiple criteria, however all the examples I have found seem to be rather complex and personal to the individuals as opposed to being rather generic. Many people, including myself would find it useful to have a simplified generic answer that can be applied to all kinds of criteria. Such as if the data in column B = x and the data in column C = y delete the row. Here is my example.

SCENARIO EXAMPLE:

In column A - Date e.g. 05/02/2011, 06/02/2011
In column B - Day
In column C - Time (in format 09:06:21)
In column D – Service numbers dialled (70, 110, 224) two to three digits long

MACRO EXAMPLE:

Delete the row if the criteria in:
Column D = 10, 40, 192 or 244
And
Column C is between 09:00:00 and 16:00:00

macro code or at least a link to a thread that they think gives a scenario as simple as this.

View 5 Replies View Related

Macro To Edit Multiple Rows Of Text

Oct 22, 2007

I used the macro editor to create a "simple" macro to edit 7 rows of text. The steps were basic and simple - F2 key, backspace about 25 times, and down arrow then repeat these 3 steps 6 more times. The macro I got gave me the result of the very first cell as I was recording the macro. I think I remember the old Lotus 1-2-3 macro text - {edit}{backspace}{down}. Wish it were still that simple.

View 5 Replies View Related

Macro Sort Rows In Multiple Sheets

Jan 31, 2014

Sorting.xlsx

I am trying to figure out how to make a macro that can sort some numbers from Largest to Smallest within a specific range on multiple sheets. The range is only within column D starting with cell D11: (until the data ends) on all the sheets in my workbook (the number of sheets may change with time) except for Sheets: "A", "B" and "C".

In other words I want the sort to work on all sheets except the first 3 sheets which are named Sheet A, Sheet B, and Sheet C.

I have attached a spreadsheet for an example of what I am saying.

View 5 Replies View Related

Macro To Find A Number In Multiple Rows

Oct 10, 2009

Sheet A – is of the following format

SlNO, Item_Description, …,…

The item_description is a combination of XXX, Part_no and Part_description all clubbed randomly. ( So I cannot use text-to-columns to bifurcate them).

Now Sheet B contains the part_number as follows :

SlNos, Part_no, ….,….,


I need a macro ( a procedure / function ) in Excel-vba, which would select each part_no in sheet – B one by one, find all those rows in which it appears in Item_Description column of Sheet-A and add a comment in the next column to it.

The Vlookup function cannot be used as it is not an exact match as the part_no is embedded among other things in item_description.

View 5 Replies View Related

Macro To Insert Rows In Multiple Tabs

Feb 19, 2010

I'm trying to figure out how to create a macro for a project at work. Basically, think of a spreadsheet with 5 tabs, but the information in Tab 1-Column D is the same in Tab-4 Column D and Tab-5 Column D. When I insert a row, though, I have to go to each tab, insert the row, and copy down the formulas from the row above to ensure the flow-through stays true. This can get very tedious.

Does anyone have a template or tips on a macro that would, in essence, work like this:

a) Highlight the row above which a row should be inserted
b) Trigger the macro
c) A row is inserted above the highlighted row in Tabs #1, #4 and #5
d) The information from the row above the inserted row is copied down to the new row in each of the three tabs.

View 6 Replies View Related

Moving Rows Into Multiple Spreadsheet Using Macro

Jan 20, 2008

Is it possible to move rows of data in a spreadsheet to multiple spreadsheet accordingly?
I had lists of tasks in a single spreadsheet and i need to segregate the tasks for all my staff in serial while no duplication among all of them. For instance, i got 4 personals in my department and i need the 1st 4 tasks to be distribute to each of them and next 4 tasks accordingly. This is due to all tasks are equip with due date and i need to calculate how much time i need to accomplishing them. i'm used to manually move it and found it time consuming, so i was wondering if someone would instruct me where or how to achieve it by using a simple macro.

View 9 Replies View Related

Macro To Sort Multiple Rows Of Data

Sep 16, 2008

I have a report that I drop down into Excel that is a transaction report for securities. The data for each security is in two rows. I would like to write a macro that would sort each two-line group by a certain cell in the group. If I could make the macro request the number of rows and columns in each range and the cell address of the cell to sort by, I would be able to use this macro for many different reports. Also, there has to be some way of telling the macro where to begin and where to end. I have some experience with macros although generally I "Frankenstein".

View 9 Replies View Related

Goal Seek Macro For Multiple Rows

Jan 27, 2008

I am trying to get Goal Seek to seek a value on each row as such:

Project 1 : Value 1 : Goal Seek using Value 1
Project 2 : Value 2 : Goal Seek using Value 2
etc....

How do I create one macro that will pick up Value 1, 2 etc and then set the Goal Seek to that value automatically, since Value 1, 2, etc will already be available in a cell? Alternativley there could be a macro that just runs that a Goal Seek for all the rows at once?

View 2 Replies View Related

Macro To Delete Rows Based On Multiple Criteria?

Jul 10, 2014

A macro is required to identify rows within a selection e.g. entire column A, that share the same value, then delete appropriate rows depending on the values in another column. The attached example details the requirements.

Extract Rec1.xlsx

View 6 Replies View Related

Macro Button To Add / Delete Rows Across Multiple Sheets

Jul 24, 2014

I've been piecing a macro together from different sites and have run into a couple issues I can't find resolutions to. I have a excel doc for tracking paint emissions per week. I would like to have a button on my master tab that will add a row and fill the formatting from the line above across all 60 some sheets. Ideally I would like the same button to first prompt if you want to add or delete rows. When adding rows I would like it to add it above the button (there's 3 buttons and for 3 different sections) and if deleting ask which row to delete. If it can't be done in one button that's fine, I can live with that. The big thing I need is for it to replicate across all of the excel sheets. I've attached a copy of the document

View 1 Replies View Related

Macro To Select 2 Rows From One Workbook To Another With Multiple Tabs On Each

Feb 21, 2014

I have 2 workbooks. The workbooks have 36 tabs for each department. Workbook 1 are current charges for the departments and workbook 2 is the revenue for each department. I would like to take the top 2 rows from workbook 2 and add them to workbook 1 at the bottom of each tab. I was able to get it to work to a specific row but the workbook 1 has variable rows for each tab.

View 3 Replies View Related

Macro To Search Multiple Values And Delete Rows.

Nov 5, 2008

How to create a macro to search a value and delete the row but I'm having trouble trying to get this to search multiple values. Keep in mind I'm really new at attempting to create a macro so this may look terrible ;-)

I have a list of 20 numbers (changes from time to time) and I need to filter any row containing any one of these numbers out of my results each day. I am currently able to filter a single group of numbers but get an end error every time I attempt to string a group of numbers.

This is what I have so far and is an example. We'll use three numbers as an example.

"12345","12346","12347" are the numbers that we'll use for the example that I need to filter. The code that I have is:

View 13 Replies View Related

Macro For Saving Multiple Rows Of Data To New Sheet

Apr 14, 2009

I am looking to save a range of data from an input sheet, to a data sheet.

I know how to save indivdual cells to a worksheet in the form of a data

what i am looking to do is save A6 - J6 down A19 - J19, but only saving the data which is entered

A6 - J6
A7 - J7

View 6 Replies View Related

Using Macro To Put Rows In Multiple Sheets In Ascending Order

Jul 22, 2012

I am looking to create a sheet that automatically updates itself in alphabetical order, when we enter any data.

here is the case:
- I've 30 secondary sheets and 1 master sheet
-----------------------------------------------------sheets detail-----------------------------------------------
Master Sheet detail:
master sheet's column A contains name from A3 to A100 (user can edit this column)Column B to to AM contains data corresponding to each name in column A

Secondary sheets detail:
column A contains name from A3 to A100 which are linked to master's column A (means any change in Master sheets' column A will change this column).................. (user cannot edit this column)column B to I contains corresponding data.
------------------------------------------------------------------------------------------------------------------

I want that when user enters a new Name in master sheet and presses "Enter" then:-
Column A of master sheet should automatically arrange itself in ascending order, along with all the corresponding data in column B to AMsince secondary sheet's column A is also linked with master sheet, so they should also be updated along with their data in corresponding columns i.e B to I

I've tried other websites and solutions for sorting of rows but since i've little experience with excel VBA, things are not quite working for me.

View 5 Replies View Related

Macro To Delete Rows Based On Multiple Criteria

Apr 9, 2009

I need a macro to delete old data from a large selection of data, in order to keep the size down.

What I want this macro to do is

Check all rows from 5 downwards.

If A5 (date) is less than cell $B$1 AND B5 is not equal to C5 then delete the whole row.

Continue until reaching the bottom.

View 9 Replies View Related

Adding Multiple Cells From Multiple Sheets With Sumif Function

Jan 20, 2009

I'm trying to put together a spreadsheet that tracks disc capacity increases, affected by any incoming projects. I've managed to do so for one project, but would like to for up to 10. The way i've designed the solution (i'm sure there are far more elegant ways, but hey) is thus:

A forecast worksheet keeps track of a grand total, taking information from sheets P1 -> P10 (being projects 1 to 10). I am unable to figure a way to add up all the increases from all 10 project worksheets with one succinct formula. What I use so far is: ='P1'!C83+SUMIF('P1'!E82,"=2009 - Q1",'P1'!D82) ..................

View 5 Replies View Related

Macro To Copy Rows From Multiple Worksheets Into One Worksheet With Only One Headings

Jul 3, 2013

I worked on a workbook which has multiple worksheets( mine has 6). The data doesn't start from A1. I want to copy the data from each worksheet into a sheet called summary. I want to create the macro that would only copy the heading row once.

WB test.xlsxWB test.xlsx

View 5 Replies View Related







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