Pasting Data

ERed1

Board Regular
Joined
Jun 26, 2019
Messages
104
Hi all,

So I am currently copying data from one sheet and pasting it to another. The data on Sheet 1 is pasted vertically and all over the place (ie: Rows 16 through Rows 19, then Rows 125 to Rows 130). Then I have different rows being copied under different circumstances. So continuing the example, I have those rows copied and then pasted and transposed on Sheet 2. Here is the current code I am using:
Code:
    If Range("B16").Value = "Dog" Then
        Sheets("Sheet1").Range("D125:D127").SpecialCells(xlCellTypeVisible).Copy
        Sheets("Sheet2").Activate
        lastrow = Range("A65536").End(xlUp).Row
        Cells(lastrow + 1, 1).PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True

I am currently copying this and pasting it and changing the ranges as need. Is there any easier way of doing this? There is a lot of data and i'd like to, if possible, clean the code up. Thanks in advance for all the help
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,224,815
Messages
6,181,136
Members
453,021
Latest member
Justyna P

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