Close Window
Got an Excel Question?

Insert 2 Rows Every Nth Row

I would like a macro to insert 2 (or more) rows every 8th row.



Free Excel Help Forum

- Ask any question about Excel and have it answered in no time.

Similar Excel Tutorials

How to Add, Remove, and Rearrange Columns and Rows in Excel
Adding, removing and rearranging columns is as easy as resizing. You just select your columns or rows, right click ...
Insert Check Mark in Excel - 3 Ways - Incl. VBA and UDF
This tutorial goes beyond other simple check-mark tutorials. Here, I'll show you 3 methods to insert a check-mark i ...
Quickly Resize Multiple Columns or Rows at Once in Excel
How to quickly resize multiple columns and rows at once in Excel.  This avoids having to individually resize rows ...
How to Find and Understand Excel Functions
In this tutorial I am going to show you how to find and understand new Excel Functions. If you go to the Formulas t ...

Helpful Excel Macros

Delete Hidden Rows in a Workbook
- This macro will delete hidden rows from every worksheet in an entire workbook. However, note that this will only delete
Delete Rows in Excel if Completely Empty
- This macro will delete only completely blank rows in an excel spreadsheet. It allows you to make a selection of rows, ru
Delete Blank Rows in Excel
- This is a macro which will delete blank rows in excel. This version will delete an entire row if there is a blank cell
Delete Entire Rows Based on Predefined Criteria (Text)
- This macro will allow you to specify certain criteria and then to delete rows based upon that criteria. You will choose
Vlookup Macro to Return All Matching Results from a Sheet in Excel
- This Excel Macro works like a better Vlookup function because it returns ALL of the matching results. Run the

Similar Topics

Could you guide me please....

I need to insert 5 blank rows repeatedly between every existing data rows
for approximately 300 rows.

If I go about doing the repeat short-cut "Control+Y", it just repeats
inserting ONE row only between the consecutive data row.

Is there some command, which helps me highlight all the rows & allows me to
insert 5 blank rows between every consecutive existing data row?

Thanks in advance for your kind advice.

I use a excel file through the course of the day and need to insert the current date in one column and the current time in the next column. I want to be able to just highlight the selected range of cells I need to insert into and hit a macro button and have the date and time inserted into just the cells I have highlighted. I'm not sure how to make this work with just the cells I've highlighted. Any help any one can give me would be greatly appreciated. Thanks!

I have a spreadsheet with thousands of columns. Due to poor planning on my part I need to insert a column between each existing column (e.g. I need to insert a column between the existing columns A and B, B and C, etc...). I would rather not have to do this manually thousands of times. Is there an easy way to do this?

Thanks in advance.

I can't find this solutions anywhere. I know how to send emails from Excel using VBA. When I get to the Body section, I want to insert a clickable link to a website, and also a clickable link to send an email (not as important as the website). Can this be done? I have found code to insert links to files, but none for website links.

I need to insert a "." into a column of cells. What is the best way to do this?

Example: Existing data 1000UG01
Needs to be 1000UG.01

Existing cells are all the same length and the "." needs to be inserted in the same place.

Thanks in advance for any help.

I have a large worksheet. Over 20,000 rows. I want to split every 900 rows into new worksheets. I need each worksheet to be 900 rows or less when done. Any macro would be helpful.

I am trying to insert a range of cell in the body of an outlook email with the same format. The code I am using now is below and it does insert anything in the email body.


Sub Mail()
Dim OutApp As Object
    Dim OutMail As Object
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail
        .To = ""
        .CC = ""
        .BCC = ""
        .Subject = "Burden Report"
        .Body = ActiveSheet.Range("A1:D12")
        .Attachments.Add ("C:\Documents and   Settings\cbelcher\Desktop\Burden Report.xls")
End With
    On Error GoTo 0
    Set OutMail = Nothing
    Set OutApp = Nothing
    Set objMsg = Nothing
End Sub


I have a question regarding filtering of columns, hopefully someone is able to put me on the right track. I have set up Excel 2007 so that I can click on the drop-down menu in each column to filter them.

However, in my data set there is one blank row separating two set of rows. Now, when I apply the filter on a column, all the rows above the blank row filter correctly, but all the rows below stay un-filtered.

I guess Excel only looks at the consequtive rows, then stops when it hits a blank row. Is there any way of applying the filter beyond a blank row (i.e. the whole column)?

Any advice is higly appreciated.

Is there a way to reduce the unused rows in a worksheet without copying the populated rows and pasting in a different tab?

Any help would be great. Thanks.

I have sheet with rows and each row has formulas based on cells in that row.
I would like to have a new row automatically inserted with the formulas
updating to reference the cells in the new row. Let's say I start with 50
rows and after they are filled up, a new row is added automatically? How do I
do this?

I have a merged cell which contains a text with multiple lines.
I want to split the lines into multiple rows.Each line should come in a different row.
I want to do this using macro.Is there is anyway to do this?
There is an option to split the cell into multiple cells on the basis of the delimiter, but there is no option to split them into rows.

Hello, what I would like to do is take a portion of a sheet..... So the cells I want to mirror are in the proposal sheet cells B32 x F51. And then mirror the exact duplicate copy to another sheet. The other sheet should have those same values at A20 X G39. What I am trying to do is have a sheet that has skus, prices, and so forth and then when I add,delete, merge, color, or do anything to the cell on the "proposal creation" sheet I want it to mirror only a specific cells to another sheet that is "salesman copy" that we will print to clients. So this way ont he proposal copy a salesman can insert rows or even change the color of the cells and then have it mirror exactly the same on the "salesman copy" which is what we will print for clients. Thank you.

how do I select (in VBA) all the rows that were filtered out by autofilter (using VBA code) and delete them leaving just header. I just can't figure out how to select entire rows when the data is filtered...
Thanks for your hints!

I need to lock consecutive rows together before sorting. e.g. A1 contains a name and A2 is blank: B1 contains data related to name in A1 - so does B2, and so on. Therefore need to lock rows 1 and 2 together, then 3 and 4 together and so on, but sorting on the data in the first cell of the group e.g. A1

Hi...hoping someone can help with a grouping problem.

I have 50 rows that I want to group. Rows 1-10 should be a group, 11-20 are a group, etc. The problem is, when I group 1-10 and then group 11-20 seperately, excel automatically makes 1-20 a single group and removes the individual groups that I wanted.

Any ideas?

Thanks in advance!

I have an Excel workbook that was created by a former coworker. It includes a macro that, among other things, displays a message box about the 2008 file. The macro runs as soon as the file is opened. I'd like to access that macro to correct the date to 2011 and see what else, if anything, it's doing for me (it doesn't appear to do much). I can find references to creating macros to hide and unhide rows/columns and I found ways to delete all macros in a workbook, but I cannot find anything about unhiding a macro without knowing its name.

Does anyone know of a way to unhide this macro?


I am looking for the code to select the visible data after applying a data filter. Actually I know how to select the data after applying the data filter but the issue is I am not able to exclude the header row and give the target range as used (non-blank) rows only!!

I am using below code to Select the Visible rows in the target range:



Problems in this code a

1) after applying the filter, while selecting the data it is selecting all the rows in given range till last row on the workbook. I need this to select the the data only till the last used row in the given range.

2) It is not possible to provide the address of the first row after we apply the filter since the first row address may change depending on the values in the table.

E.g. 1st time when I am running the macro the first row in the visible filtered data is starting at Cell address A4 and next time when I will run the macro it may be A6

3) The Code is also selecting the 1st row which is a header row. How can we exclude it from selection.

Some one please revert with the solution.
Thanks in advance.

Hi peeps

I want to combine data from several worksheets into one worksheet.

For example, I have data in Sheet1 (Columns A,B,C), data in Sheet2 (Columns A,B,C), data in Sheet3 (Columns A,B,C) all with varying amounts of rows. (All the rows contain text data).

I need to combine all of the data from the 3 sheets into a single sheet, Sheet4 (Columns A,B,C), eliminating the empty rows.

I've been looking into this for a while, and can't find anything that really helps. Anyone got any pointers of what to look into?

Any help will be beautiful.


Hi all.

I have set up a workbook that is sent out to lots of different users. They each keep and use their own copy.

I have set it up so that everything looks OK and is visible on MY screen, but I'm conscious that some users may have different screen sizes, different toolbars set up, and so on, which might make some parts not immediately visible to them.

I have set up an auto-execute macro which automatically sets the zoom factor to best fit, for several of the worksheets, and this works fine.
Here's the code that does it.

    ActiveWindow.Zoom = True

By repeating this code for each worksheet, I can make each one be zoomed just right.

However, the file contains 8 sheets that are all identically laid out, except the number of rows is different.
What I want to do is go to the worksheet that has the largest number of rows (it's always the same worksheet, so I know which one it is), set the zoom factor for THAT worksheet (which I can do, and it always has the same number of rows), and then take THAT zoom factor, whatever it is - and it will vary depending on the user - and apply that to the other worksheets that have a similar layout.

I could just go through each worksheet and zoom it automatically, but that would mean that some of the sheets looked very large, others very small, and I'd like them to have a consistent appearance.
I could also specify a range on each worksheet that was similar to the appropriate range on the longest worksheet, and zoom that automatically, but that's not ideal either, because some of the row heights vary from sheet to sheet, and again I'll end up with different font sizes.

Anyone know how to do this ?

How do I restrict what I see on my screen (and specifically, limit the scroll
feature) to the rows and columns I'm actually using in an Excel 2003 Pro


I am brand new to Mr. Excel and would love some advice.

I searched the boards pretty extensively but could not find what I am looking for...I apologize if this is a duplicate.

I am using Excel 2007

How do you automatically add rows and update values for cells to a linked worksheet in which rows have been added? For example: Sheet 1, columns A & B are linked to Sheet 2, columns A & B. Sheet 2 has values in A1:A5 & B1:B5 and Sheet 1, since it is linked, has the same info. I want to add a row in between 3 & 4 on Sheet 2 and want Sheet 1 to automatically add the same row and update the value of the cell in column A & B.

Any help is greatly appreciated!



As the title goes this is as simple as it gets. The macro worked good when I was using excel 2003 but now that I have 2007 everything works for except the resizing (Picture.Width & Picture. Height).


Sub AddImage()
Dim strPath As String
Dim strFile As String
Dim Picture As Object
Dim Response As String
Dim C As Range
strPath = "C:\\Photos\"
For Each C In Range("A1", Range("A65536").End(xlUp))
    If C  0 Then
        With C.Offset(0, 1)
            Set Picture = Nothing
            On Error Resume Next
            Set Picture = Sheets("Raw Pix").Pictures.Insert(strPath & C.Value & ".jpg")
            Picture.Top = .Top
            Picture.Left = .Left
            Picture.LockAspectRatio = msoTrue
            Picture.Width = 157
            Picture.Height = 138

    End With
    End If
Next C
End Sub

I have tried to record some macros while I am resizing the pictures but to no avail the macros are blank.

Please help


I feel like this should be really easy and I am just out of it today but I cannot figure this out. I want to lock a row and filter (with filter,not sort, tool) the other rows. I attached an example

The row in RED I want to never be changed or added in the filter, but I want row 2 and 1 to filter together. So I want (in this case) the flavor to filter with the same number. SO i guess the filter process would be dependent upon the total number of votes. Any ideas? Thanks!

I had to create the information in tables and went from there. Got it. Thanks!

How I Can Maintain The Stock Register On Excel Sheet By Date Wise ?

But I do not want to insert any sheet for different dates & also the format will not be copied & paste in the same sheet. Just at the place of Date the date will be changed & the datas will be entered manually for each day.

In future, when I shall put the date, the datas will show that particular date's datas only.

Can anyone help me ?