duplicate text

  • Thread starter Thread starter Kiannie
  • Start date Start date
K

Kiannie

I want to duplicate names, example :

Dog
Cat
Duck

duplicate to

Dog
Dog
Cat
Cat
Duck
Duck
 
With your data in column A, In B1 enter:

=INT(ROUNDDOWN((ROW()+1)/2,1))-1 and copy down

In C1 enter:

=OFFSET($A$1,B1,0) and copy down. For example:

hat 0 hat
cat 0 hat
bat 1 cat
rat 1 cat
mouse 2 bat
bird 2 bat
flea 3 rat
3 rat
4 mouse
4 mouse
5 bird
5 bird
6 flea
6 flea
 
Or you can do it with a simple macro:

Sub insdup()
For ancell = 4 To 2 Step by - 1 ' replace 4 by real No of rows
Rows(ancell).Copy
Rows(ancell + 1).Insert Shift:=xlDown
Application.CutCopyMode = False
Next ancell
End Sub

Regards,
Stefi

„Kiannie†ezt írta:
 

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