Code for Tom and Frank

D

Dan

Hi again:

Frank, yours is working now, but my mistake, I would need
inserted not the whole row; just for the 3 columns: sort
of shift cells down; there are other columns after c and I
have autofilter; something like belowlike below...
1 1 OK a
2 2 OK a
b
3 4 NO c
57 7 NO a


Thank you very much,

Dan

PS Tom your did not have a result...
 
T

Tom Ogilvy

PS: Dan, it worked fine for me and the technique is identical to Frank's,
so Don't think the problem is my code - at least not with the information
you presented.

Please try to stay in the thread and not start new threads without context.
 
F

Frank Kabel

Hi
see Tom's response. Not sure what your issue is. Also I totally agree
with tom: Please stay in thhe original thread. Don't worry, we'll read
your response
 
D

Dan

Hi guys:

I understand!

My issue is that I do not want to inser a entire row just
shift the cells down up to column c(including):

1 1 OK a
2 2 OK b
c
3 4 NO d

Thanks,

Dan
 
F

Frank Kabel

Hi
try:
Sub insert_rows()
Dim lastrow As Long
Dim row_index As Long

lastrow = ActiveSheet.Cells(Rows.count, "C").End(xlUp).row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index+1, "C").Value ="No" Then
Cells(row_index + 1, "A").resize(1,3).Insert (xlShiftDown)
End If
Next
End Sub
 
Top