vbscript - copying column from one excel to another -
i have specific requirement copy b column each workbook , paste them sequentially in master work book.
e.g. wb1, wb2 wb3 workbooks, , master should have data following ways:
- copy wb1 data b3 onwards till value exists , paste matser workbook b3 column onwards
- copy wb2 data b3 onwards till value exists , paste master workbook c3 column onwards
- copy wb2 data b3 onwards till value exists , paste master workbook d3 column onwards
and on other workbooks
i using vbs unable find requirement. in regard appriciated. in anticipation.
this had been trying...
set objexcel = createobject("excel.application") set sourcewb = objexcel.workbooks.open(sourcefilepath) set destwb = objexcel.workbooks.open(destfilepath) objexcel.visible = true set sourcews = sourcewb.sheets(sourcesheet) set destws = destwb.sheets(destsheet) sourcews.activate set sourcecolumn = selection.sourcews.offset(3, 1).range("b1").select set targetcolumn = destws.range("b3") sourcecolumn.copy
you can't use selection.sourcews...
because vbscript has no clue selection
is. global selection
object exists within excel/vba.
see this post more information on using excel objects vbscript.
Comments
Post a Comment