Copy each data record of a name list and place it under the onecopied

A

andreashermle

Dear Experts:

I got a name list on a worksheet with the following columns

SURNAME NAME CITY
Smith John New York City
Wilber Joe Denver
Garden Thomas San Diego


This list has for example twenty rows / data records. For certain
reasons the following action should be excecuted automatically (using
VBA) on my list regardless of the number of rows:

Duplicate each row and place it directly under the one copied. The
result would then look like this:

SURNAME NAME CITY
Smith John New York City
Smith John New York City
Wilber Joe Denver
Wilber Joe Denver
Garden Thomas San Diego
Garden Thomas San Diego

Help is much appreciated.

Thank you very much in advance. Regards, Andreas
 
D

Don Guillett

Sub copyeachrow()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
Rows(i).Copy
Rows(i + 1).Insert
Next i
End Sub
 
A

andreas-hermle

Sub copyeachrow()
For i = Cells(Rows.Count, 1).End(xlUp).Row To 2 Step -1
Rows(i).Copy
Rows(i + 1).Insert
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software












- Zitierten Text anzeigen -

Great, it is working. Thank you very much for your professional help.
Regards, Andreas
 

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