简体   繁体   中英

copy dynamic range, VBA , EXCEL

My datas are as shown in the picture. I want to copy ranges in column E and paste it to another sheet . how do i select a range in column "E" according to Column "D" ?.

Thanks 在此处输入图片说明

Assuming you've already got the reference in the D column, through .Find for example, you can copy the E portion as follows using .Offset .

range([D1],[D1].end(xldown).offset(-1)).offset(,1).copy

Assuming your sd value is in range D1, this will copy the values 2 to 7 from the E 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