Extracting data from workbook1 to workbook2

  • Thread starter Thread starter ranjan.khan
  • Start date Start date
R

ranjan.khan

Hi,

I would appreciate any VBA code for the following:

I need to extract data from say ColumnA, ColumnB, ColumnE and ColumnG
from "workbook1"
and placed this data in the corresponding columns (ColumnD, ColumnF,
ColumnH, and ColumnK) in "workbook2".

Can you help?

Thanks Ranjan
 
Hi,

I would appreciate any VBA code for the following:

I need to extract data from say ColumnA, ColumnB, ColumnE and ColumnG
from "workbook1"
and placed this data in the corresponding columns (ColumnD, ColumnF,
ColumnH, and ColumnK) in "workbook2".

Can you help?

Thanks Ranjan

Sub CopyWbk
Dim src, dest
i=1
Set src=Workbooks("Workbook1").Sheets("Sheet1")
Set dest = Workbooks("Workbook1").Sheets("Sheet1")
While src.Cells(i,1)<>""
dest.Cells(i,4)=src.Cells(i,1)
dest.Cells(i,6)=src.Cells(i,2)
dest.Cells(i,8)=src.Cells(i,5)
dest.Cells(i,11)=src.Cells(i,7)
i = i+1
Wend
End Sub

HTH
Kostis Vezerides
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top