简体   繁体   English

复制动态范围VBA EXCEL

[英]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 . 我想复制E列中的范围并将其粘贴到另一张纸上。 how do i select a range in column "E" according to Column "D" ?. 如何根据“ D”列在“ E”列中选择一个范围?

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 . 假设您已经在D列中获得了引用(例如,通过.Find ,则可以使用.Offset如下复制E部分。

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. 假设您的sd值在D1范围内,这将从E列中复制值2到7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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