简体   繁体   中英

Copy multiple rows from one worksheet to another worksheet

Copy multiple rows from one worksheet to another worksheet

I have a query, i have one workbook which has got around 21 columns and around 1000 rows..However i just need 4 columns

for example

let says work book A has got these columns vmware ,powerstate, dns,cpyu,memory,ssid,disk,....Here i just need vmware ,powerstate,cpu,memory and disk on workbook b.

I have tried pivot table. it just went haywire.I have a bit of vb.which i am not sure where it landed.

can any one help

You can copy rows using the following VBA Code

ThisWorkbook.Sheets("Name Of Your Source Sheet").Columns(1).Copy
ThisWorkbook.Sheets("Name Of The Destination Sheet").Columns(1).PasteSpecial xlPasteValues

Replace the 1 in Columns(1) in the first line by the number of the column you want to copy in your source sheet.

Replace the 1 in Columns(1) in the second line by the number of the column you want to paste your copied column.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM