Copy cell from rows to column followed by copying it a fixed number of times

yhbyhb

New Member
Joined
Oct 31, 2014
Messages
4
Hi,

I have data in this format:

APPLE BANANA CARROT DOG ELEPHANT FISH

And would like to make it like this:

APPLE
APPLE
APPLE
BANANA
BANANA
BANANA
CARROT
CARROT
CARROT
ELEPHANT
ELEPHANT
ELEPHANT
FISH
FISH
FISH

Should i be using
Dim i As Integer
For i = 2 To 4
Cells(i, 1).Value = Range("D1")
Next i

If so, how do i change the row to make sure it starts copying a new cell after every 3 rows? And, how do i change the range "D1" to the next cell after i finish 3 copying it for 3 rows?

Thanks for helping!
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Welcome to the forum

In what cells do you have the original data and what cells(row/column) do you want to copy them to?
 
Upvote 0
I have it in this format:

A B C D E F G H
1 Name Type Colour Apple Banana Carrot Elephant Fish
2
3
4

And would like to make it to this:

A B C D E F G H
1 Name Type Colour
2 Apple
3 Apple
4 Apple
5 Banana
6 Banana
7 Banana
8 Carrot
9 Carrot
10 Carrot
11 Elephant
12 Elephant
13 Elephant
14 Fish
15 Fish
16 Fish

How should i go about doing it? Thanks for the reply!
 
Last edited:
Upvote 0
Something like this
Code:
Sub codecopy()
    Dim lrow As Integer, i As Integer, j As Integer
    lrow = 2
    For j = 4 To 8 'Apple is in column 4 all the way to Fish in col 8
        For i = 1 To 3 'bcos you want to copy it 3 times
            Range("A" & lrow) = Cells(1, j)
            lrow = lrow + 1
        Next i
    Next j
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,332
Members
449,077
Latest member
jmsotelo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top