How to copy rows of only values from a worksheet to a column in a second worksheet

I have a sheet "Creation" where I need data to go. I have second sheet "Abomination" where I need to pull data from. In Abomination I have a row data starting at D6. n Creation I have a column with the first cell B2, where the data from Abomination needs to go. Both the Row in Abomination and the Column in Creation will vary in terms of cells. Basically Abomination is one of many sheets in the same format where I will be pulling data from. I just started learning VBA on Friday, please bare with me. This code only pulls the last cell value from abomination:

Sub Bob()

Dim Creation As Worksheet
Dim Abomination As Worksheet
Dim destRange As Range
Dim sourcerange As Range
Set Creation = Worksheets("Creation")
Set Abomination = Worksheets("Abomination")

With Abomination

Set sourcerange = .Range("D6").End(xlToRight)

End With

With Creation

Set destRange = .Range("B2")

End With


destRange.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=True

End Sub
Set sourcerange = .Range("D6").End(xlToRight)

using End() doesn't extend the range from D6, it just moves to a different range mimicking pressing Ctrl+right arrow

Maybe you want something like:

Set sourcerange = .Range(.Range("D6"), .Range("D6").End(xlToRight))

0 Comment



Captcha image