Inserting Rows

  • Thread starter Thread starter StuNVA
  • Start date Start date
S

StuNVA

I have a spreadsheet that I need to insert a blank row under a number
everytime it changes. The column may have 500 rows and the first twenty
or so may all be the number 10 for example, the next five might be the
number 8, I need a row between the last number ten and the first number
eight. This may be repeated many times through the spreadsheet.

Any help would be appreciated, I am not really up to speed on Macros
and such but have a good handle on formula's, so if the problem is
fixed using macro's please use as plain english as you can.

Thanks

Stu
 
If your numbers are in column A
and if the numbers are truely equal
and if there are no blanks initially
try

sub blnkentery()
nr=Application.WorksheetFunction.counta("A:A")
for r = nr to 2 step -1
cells(nr,1.select
if cells(nr,1) <> cells(nr-1,1) then Selection.EntireRow.Insert
next r
end sub
 

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

Back
Top