View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
frendabrenda1
 
Posts: n/a
Default macro to add a row

Thank you so much..... I did have INSERTPT looking at the wrong cell...should
have been A2.....

(I put the one spot back to a -1...that was just me trying to mess with
things to get it to work before.)
But....

It is now adding a row directly beneath and filling it with what looks like
a paste (but not as values) leaving formulas and pasting as values over the
original record number.

Any ideas?????

"Dave O" wrote:

Your code has this line that assigns a value to INSERTPT:
INSERTPT = ActiveCell.Value
.... and later, an IF statement that compares a cell value to INSERTPT:
If Cells(i, 1).Value = INSERTPT Then

Is it possible the value in Cells(i, 1).Value never equals INSERTPT?

The other thing I notice is this line
For i = iLastRow To 1 Step 1
In order to get this structure to run, I had to change it to this:
For i = iLastRow To 1 Step -1
Is that a similar problem for you?