VB: How do I find next blank row then add another blank row

G

Guest

I have a fairly large spreadsheet wherein there are multiple rows of related
data separated by single blank rows. I need VB code that will find each of
the blank rows and then add another blank row adjacent to it so that I will
have a total of 2 blank rows between each set of related data. Any
suggestions would be greatly appreciated!
 
G

Guest

Hi,
Assuming by blank you mean empty (does not contains empty string "").
Can such blank rows be located by only looking if the cell is blank in a
particular column? If so, say it is column A. then for A1:A100:
Dim rg As Range
Set rg = Range("A1:A100").SpecialCells(xlCellTypeBlanks)
rg.EntireRow.Insert shift:=xlDown
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top