How do I paste data to an variable row?

  • Thread starter Thread starter DAVE McClean
  • Start date Start date
D

DAVE McClean

Any help on this would be greatly appreciated. What I'm trying to do is copy
data from a set range of cells, and paste that data to a variable row & set
column.
Thank You

Dave
 
Dim VarRow as Integer
VarRow = Some formula to find a row
Range("B6:C" & VarRow).Paste
 
Dim rng as Range
set rng = worksheets("sheet1").Range("B1:C20")
rng.copy Destination:=Worsheets("sheets2"). _
Cells(rows.count,1).End(xlup)(2)
 
you don't say how you select the source that you want to copy.
So...

Dim Source as Range
Dim Target as Range
SET Source = Worksheets("Sheet1").Range("G5:M27")
'or as another example...using a user-selected range
'SET Source = Selection

Set Target = Worksheets("Sheet3").Range("C3")
' or if the sourec was defined
SET Target = Selection

'now copy the data
With Target.Resize(Source.Rows.Count, Source.Columns.Count)
.Value = Source.Value
End With
 
Back
Top