PDA

View Full Version : Copying Data from One Sheet to Different Sheets



rahulkcjain
08-16-2013, 01:08 PM
I have one excel file wherein i have alphanumeric data in cells A1:A85 & B1:B85. (In Sheet 1)


I have another 85 sheets in the file. I want to pull data of A1 into D20 & data of B1 into E20 (In Sheet 2)


I want to do these in all the 85 sheets in sequential order. i.e. Sheet 2 should pull data of A1 & B1(Sheet 1), whereas Sheet 3 should pull data of A2 & B2(From sheet 1), and Sheet 4 should should pull data of A3 & B3(from Sheet 1) and so on.


Can you please help me with this?


Thanks in advance.

Doug Robbins
08-16-2013, 09:38 PM
Use:


Dim arrData As Variant
Dim i As Long, j As Long
arrData = Sheets(1).Range("A1").CurrentRegion
For i = 1 To UBound(arrData, 1)
With Sheets(i + 1)
.Range("D20") = arrData(i, 1)
.Range("E20") = arrData(i, 2)
End With
Next i