# Insert Rows On Multiple Sheets

Apr 2, 2008

way to automatically insert rows and copy data on multiple selected sheets. for example, if i insert a row anywhere on sheet 3, i need that same row inserted in the same location with the cells populated with the same data on sheets 4, 6 and 9.

## Insert Rows On Multiple Sheets?

Apr 2, 2008

I need to figure out a way to automatically insert rows and copy data on multiple selected sheets. for example, if i insert a row anywhere on sheet 3, i need that same row inserted in the same location with the cells populated with the same data on sheets 4, 6 and 9.

## Insert Copied Rows In All But 3 Sheets

Apr 19, 2008

One of the sheets in my workbook has 5 rows (Rows 1 - 5) that I need to copy and insert at the top of all but 3 of the other worksheets. I can specify the names of the 3 worksheets that I want to avoid changing. The other worksheets will be named differently each time I use the macro.

## Workbook With 61 Sheets - Insert Two Rows At The Top Of Each Sheet

Jul 11, 2007

I have a workbook with 61 sheets in it.

What I need to do is insert two rows at the top of each sheet. Now I know I can manually do it, or write a macro to, that bit's easy.

However, when I insert the rows, a lot of my formulas try to pick out the wrong range.

So for example, lets say we're looking at sheet 1. When I insert 2 rows at the top this style of formula still works...

=B14/B12 (it automatically becomes =B16/B14)
=SUM(B10:B11), =B12+B14, =B12*0.25, these also update automatically.

Even a reference to ='Sheet 2'!B48*2 still updates automatically. But formula's of this kind do not...

=SUM(Sheet4:Sheet10!B5)
(regardless of inserting 2 rows, this formula does not change to =SUM(Sheet4:Sheet10!B7) )

## Compare Cells Across 2 Sheets & Insert Rows If Criteria Met

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".

## Macro: Insert Multiple Sheets & Name As Cell

Dec 15, 2006

I found a macro code in this forum (Macro: Insert Sheet & Name As Cell Text first empty cell it should stop, but I do not know how to do that. (for example: If cells text is: A1: DOG, B1: CAT, C1: MOUSE then macro should create worksheets named DOG, CAT and MOUSE). I would save code to macro.xls file, in that file it would be also worksheet named LIST with cells names A1: DOG, B1: CAT, C1: MOUSE... in first row. But I would like to run macro on other files, so this new worksheets would be created in that new file and not in macro.xls where where macro and LIST are saved.

Dim strName As String
strName = Sheets(1).Range("A1")
ActiveSheet.Name = strName
End Sub

## Insert Multiple Rows

Oct 29, 2009

Need code to insert multiple rows. I would like to be able to click a command button and have the number i have entered in a textbox be the number of rows inserted in the spreadsheet above a static cell like A12.

## Insert Multiple Rows And Label Accordingly

Oct 27, 2009

in inserting 8 rows as per the attached spreadsheet highlighted in orange, and labelling them, obviously, the year after the one above it.

## Insert Multiple Rows After Each Row Of Text?

Dec 1, 2011

I have a spreadsheet with about 10,000 lines/rows of text and I want to insert 4 lines/rows under each of these. way to do this efficiently without having to insert under every line/row?

## VBA To Insert And Delete Multiple Rows

May 30, 2009

Does anyone have codes to insert and delete multiple rows. I need to run a macro where a dialog box pops up requesting number of rows to insert and delete.

## Insert Numbers Before Data In Multiple Rows

Jan 7, 2009

I have a string of numbers ex. 1234, 5678, 91011 in 400 rows. Before each string I would like to add 88.

## 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.

## Insert Rows Between Data For Multiple Tables

Dec 12, 2013

I need to insert a blank row between each row of data under my headers (not the immediate row) until I reach the end of the particular table. I then move down to the next header and repeat the process.

My starting data looks like this:

DATAROW1
DATAROW2
DATAROW3
-emptyrow-
DATAROW1
DATAROW2
DATAROW3

I need it to look like this:

DATAROW1
-emptyrow-
DATAROW2
-emptyrow-
DATAROW3
-emptyrow-

[Code] .....

## Copy Data Into Multiple Rows Using Macros And Insert Zero

Apr 21, 2014

I'm new to Macros and below is my requirement.I need to split my data into multiple rows based on count and the first row should have the value but the other rows should have a value as zero.

Input

Count Value
1 400
2 101
3 300
4 450

Output

Count Value
1 400
2 101
20
3 300
3 0
3 0
4 450
4 0
4 0
4 0

## Insert Multiple Blank Rows At Designated Cells

Jun 13, 2014

I have a large list of cells in excel: 15, 33, 90, 102, 149, 159, 217, 228, 238, 247, 305, 312, 369, 417, 428, 486, 538, 548, 606, 621, 671, 679, 737, 805, 816, 874, 915, 923, 981, 1029,1038 .

Under each of these cells I would like to insert 20 blank rows. I have tried various codes but i'm struggling with the fact that as soon as I insert 20 rows at cell 15, all the other cellnumbers change.

This is a reformulation of this post: [URL] ...........

## 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] .....

## 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.

## Cycle Through Multiple Rows On Multiple Sheets?

Mar 11, 2014

Data starts on row 4 of each sheet except for the "Labels" sheet where data is pasted.

I need to skip the sheet if there is no data supplied in it and move to the next sheet.

## Unhide Rows In Multiple Sheets?

Oct 12, 2011

Is it possible to unhide a row in one sheet and the same line can be un hidden automatically ini 2 other sheets within the same workbook

## Delete Rows On Multiple Sheets Below

Apr 22, 2007

One more short macro code I would like to have.

I would like to delete rows on all worksheets in a workbook below where the value "Total" exists in column B (same on all sheets).

## Sum Matching Rows From Multiple Sheets

Jun 14, 2008

I'm working with 2 sheets. Both have the same headings, A1 is CustomerCode, C1 is JAN, D1 is FEB and so on. The CustomerCode column doesn't match exactly between the 2 sheets, because some of the customers from Sheet1 aren't listed on Sheet2. I need a formula to put on Sheet 3 that will Sum the values in JAN, FEB, etc from the first 2 sheets for matching customers, and also bring over the totals from the customers on Sheet 1 that don't have a match on Sheet 2.

I have attached an example of how the finished product would look in my case. But also, here's this:

Sheet1 Charges

CustomerCode JAN FEB
ABC 30 25
AEF 20 15
BBB 50 30
CED 15 20

Sheet2 Misc Charges

CustomerCode JANFEB
ABC 510
BBB 3 8
CED 2 4

Need Sheet3 To look Like this:

Sheet3 Total Charges

CustomerCode JANFEB
ABC 3535
AEF 2015
BBB 5338
CED 1724

New customers are added often, so I have a SQL Query that I can put in column A of sheet3 that will pull the same CustomerCode list as sheet1, so getting the names to sheet3 shouldn't be an issue.

## Delete Rows Based On Value In Multiple Sheets?

Apr 2, 2014

I have the following code to delete rows based on the value "No" in cloumn "L". This code should loop through all sheets and delete the corresponding rows.

[Code]....

The code works perfectly but with one little issue. It fails in the first run always with the following error message.

VBA error.png

I need to comment out the line

[Code] ....

continue it with a breakpoint to "End With", remove the comment. Then it loops all worksheets and deletes the rows.

There is no protection or similiar on any sheet.

## 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.

## Copy Rows From One Book To Multiple Books And Sheets

Nov 16, 2009

I'm trying to copy rows from one workbook that is exported from access to multiple worksheets in multiple workbooks. I used a macro I found here from JBeaucaire that will copy the data for me but it over writes the information I have in rows 1-3 and also the rows below, 28-35.

Is there a way to copy the data without loosing the information in the first three rows and the rows below where the data goes?

## 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

## 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.

## Copy Rows From Multiple Sheets To Master Sheet?

Apr 20, 2013

the code below was created by: JoeMo I'm trying to adapt, but I need to say which worksheet you were to NOT be copied

Code:
Sub MergeSheets()'Author: JoeMo
'http://www.mrexcel.com/forum/excel-questions/683803-copying-data-multiple-sheets-appending-master-sheet-reverse.html

[Code].....

## How To Delete Rows With Strikethrough On Column A Among Multiple Sheets

Nov 24, 2013

I have a workbook with multiple sheets. I want to use VBA macro to delete the row where the first column is strikethrough. I try to the follow VBA code but it doesn't work.

Sub Macro1()
Dim cell As Range
Dim delRange As Range

[Code]....

## Merge Selected Rows From Multiple Sheets Into One Sheet

Jul 14, 2009

I have around 150 excel files with sample data as follows in "sheet 1" of each workbook,

Excel doc 1:

ABC1
Column 1Column 221Data 1Data 132Data 2

Excel doc 2:

ABC1

Column 1Column 223Data 3Data 334Data 4

I want the rows with data in column 'B' and empty column 'C' from every sheet to be copied into 1 sheet.

Output to be as,

Final Excel doc:

ABC1

Column 1Column 222Data 2
34Data 4

I have a VBA code sample to select the required files in a folder and run the macro over it. The VBA is as follows,

Sub Importxlsrows()
'Import all selected rows to one sheet
Dim xlsDoc As Object
Dim xlsFileName As Variant
Dim RowNo As Integer 'row number in excel
Dim iRow As Long 'row index in Excel

'probably here we need to insert the required logic

End With
Set xlsDoc = Nothing
End If
Next i
ShowStatusFree
MsgBox "Required rows of selected files are imported into the sheet", vbInformation, "Done!"

End Sub

## Hide Rows Based On Condition - Multiple Sheets

Mar 7, 2008

I want by using some code I've seen on this forum or using the macro writer and then tweaking the code. So with that said, I've written the attached code but I know there is probably an easier way to write it. It cycles through about 12 sheets using the same below code, but I didn't list that code.

Sub Hide_Rows()
Dim i As Integer
For i = 3 To 418
Sheets("AFA - UMBI").Select
If ActiveSheet. Range("b" & i).Value = "2008-2" Then
Rows(i & ":" & i).EntireRow.Hidden = True
ElseIf ActiveSheet.Range("b" & i).Value = "2008-3" Then
Rows(i & ":" & i).EntireRow.Hidden = True
ElseIf ActiveSheet.Range("b" & i).Value = "2008-4" Then
Rows(i & ":" & i).EntireRow.Hidden = True
ElseIf ActiveSheet.Range("b" & i).Value = "2009-1" Then
Rows(i & ":" & i).EntireRow.Hidden = True
ElseIf ActiveSheet.Range("b" & i).Value = "2009-2" Then
Rows(i & ":" & i).EntireRow.Hidden = True
ElseIf ActiveSheet.Range("b" & i).Value = "2009-3" Then
Rows(i & ":" & i).EntireRow.Hidden = True
ElseIf ActiveSheet.Range("b" & i).Value = "2009-4" Then
Rows(i & ":" & i).EntireRow.Hidden = True
End If
Next i
End Sub