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:
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
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