Macros to Cut and Paste

D

David

I have the following macro and I need one additional step after it finished the macro. The initial macro added 10 rows until the last person is there, but there are values in b1, b10,b20, etc and I need those values to cut and pasted in a10, a15 and so on until the last value has been posted. If somebody can help I would really appreciate it.

Sub insert_rows(
Dim lastrow As Lon
Dim row_index As Lon

lastrow = ActiveSheet.Cells(rows.Count, "A").End(xlUp).ro
For row_index = lastrow - 1 To 1 Step -
If Cells(row_index, "A").Value <> Cells(row_index + 1, "A").Value The
Cells(row_index + 1, "A").Resize(10, 1).EntireRow.insert (xlShiftDown
Range(Selection, Selection.End(xlDown)).Selec
Range(Selection, Selection.End(xlToRight)).Selec

End I
Nex

End Su
 
D

David McRitchie

It is unclear how on column row 1 + 9 rows + 10 rows
relates to row 10, row 15,
--
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

David said:
I have the following macro and I need one additional step after it finished the macro. The initial macro added 10 rows until the
last person is there, but there are values in b1, b10,b20, etc and I need those values to cut and pasted in a10, a15 and so on
until the last value has been posted. If somebody can help I would really appreciate it.
 

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