Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copying Rows from one spreadsheet to another 1

Status
Not open for further replies.

EliseFreedman

Programmer
Dec 6, 2002
470
GB
Hi There

I have a spreadsheet which contains data generated from a 3rd party application. I am trying to cycle through all the rows in a particular column in the worksheet and copy the data to a column in another worksheet.

at the moment i have got
Code:
For i = 2 To 20
Range("J" & i).Value = Range("G" & i).Value
Next i

although this works, I would rather have it that the data is copied onto another worksheet

How do I do this?
 
With code external to both workbooks:
Dim vArray
vArray = Workbooks("SourceWbkName").Worksheets(1).Range("G1:G20")
Workbooks("TargetWbkName").Worksheets(1).Range("J1:J20") = vArray


combo
 




Hi,

or this...
Code:
Workbooks("SourceWbkName").Worksheets(1).Range("G1:G20").Copy
Workbooks("TargetWbkName").Worksheets(1).Range("J1:J20").PasteSpecial xlPastevalues

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top