0

I am trying to copy data from one sheet to another using VBA For loop. For some reason when I execute the below code the data is not being copied in one column under each other but in a strange format as shown below.

Sub Macro2()

For i = 110 To 116
For j = 1 To 1


Worksheets("overview of contracts").Activate
Range("A" & i).Select
Selection.Copy
Worksheets("Sheet1").Activate
ActiveCell.Offset(1, 0).Range("C" & j).Select
ActiveSheet.Paste

'Worksheets("overview of contracts").Activate
'Range("B" & i).Select
'Selection.Copy
'ActiveCell.Offset(1, 0).Range("D" & j).Select
'ActiveSheet.Paste

'Range("C" & i).Select
'Selection.Copy
'ActiveCell.Offset(1, 0).Range("E" & j).Select
'ActiveSheet.Paste

 Next j
Next i

End Sub

Result:

enter image description here

This is the original data, what I am trying to achieve is copy that data to another sheet using a loop exactly in that format and sequence. Sample Data

TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

1

I think this is what you want. It takes values in sheet("overview of contacts"), and copies their values to sheet("Sheet1") in column C, descending rows.

Sub Macro3()
    Dim i As Long
    Dim j As Long
    j = 2
    For i = 110 To 116
        Worksheets("Sheet1").Cells(j, 3).Value = Worksheets("Overview of Contracts").Cells(i, 1).Value
        j = j + 1
    Next i
End Sub
Warcupine
  • 4,460
  • 3
  • 15
  • 24