Looping through a set Spefiic set Range and Pasting in next empty cell in another column

KNKN9

Board Regular
Joined
Mar 27, 2017
Messages
92
Hi,

I have this code below, which selects a range in each line and paste the data in another sheet in column E in the next empty cell.

I do this for an offset up to 116 and this may increase. I am struggling to find a loop code that will loop through a set range and paste the data in Column E in the next empty cell.

Code:
Sheets("Brands_2018 FC").Range("W10:AC10").Copy
Sheets("Sheet9").Range("E2").PasteSpecial Transpose:=True
Sheets("Brands_2018 FC").Range("W10:AC10").Offset(1, 0).Copy
Sheets("Sheet9").Range("E2").End(xlDown).Offset(1, 0).PasteSpecial Transpose:=True
Sheets("Brands_2018 FC").Range("W10:AC10").Offset(2, 0).Copy
Sheets("Sheet9").Range("E2").End(xlDown).Offset(1, 0).PasteSpecial Transpose:=True


Thank you very much for your help in advanced !
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
How do you determine the number of rows to transpose?
Let's say we can use column W to find the last row with data, like this:
Code:
Dim rw as Long
rw = [COLOR=#333333]Sheets("Brands_2018 FC").[/COLOR]Cells(Rows.Count,"W").End(xlUp).Row

Then you could use a loop something like:
Code:
For i = 10 to rw
    [COLOR=#333333]Sheets("Brands_2018 FC").Range(Cells(i, "W"), Cells(i,"AC")).Copy
    [/COLOR][COLOR=#333333]Sheets("Sheet9").Range("E2").End(xlDown).Offset(1, 0).PasteSpecial Transpose:=True[/COLOR][COLOR=#333333]
[/COLOR][COLOR=#333333]Next i[/COLOR]
 
Last edited:
Upvote 0
Thank you for this. I have only just not been able to test this out and it works perfectly as needed.

Much Appreciated!
How do you determine the number of rows to transpose?
Let's say we can use column W to find the last row with data, like this:
Code:
Dim rw as Long
rw = [COLOR=#333333]Sheets("Brands_2018 FC").[/COLOR]Cells(Rows.Count,"W").End(xlUp).Row

Then you could use a loop something like:
Code:
For i = 10 to rw
    [COLOR=#333333]Sheets("Brands_2018 FC").Range(Cells(i, "W"), Cells(i,"AC")).Copy
    [/COLOR][COLOR=#333333]Sheets("Sheet9").Range("E2").End(xlDown).Offset(1, 0).PasteSpecial Transpose:=True[/COLOR][COLOR=#333333]
[/COLOR][COLOR=#333333]Next i[/COLOR]
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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