xiaowu6886 发表于 2010-5-28 20:49:00

大侠们怎样用VBA‘批量’朝X或Y 方向复制某个图形,哪位大侠能帮帮忙。小弟感激不尽

大侠们怎样用VBA‘批量’朝X或Y 方向复制某个图形,哪位大侠能帮帮忙。小弟感激不尽!!!!<p><font face="Verdana">怎样用VBA实现‘批量’朝X或Y 方向复制某个图形,哪位大侠能帮帮忙。小弟感激不尽!!!!</font></p>
<p>急用,老师叫我们搞毕业设计,以前都没学过VBA,弄不来。</p>
<p>希望有人帮帮忙!!!!</p>

qihuiqiang 发表于 2010-5-28 22:07:00

联系我QQ534206572

jerry1988 发表于 2010-6-18 11:23:00

<p>阵列 核心代码如下:</p>
<p>&nbsp;</p>
<p>先要设置Set lineobj和Set lineobj1(即画线) 然后,</p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">'偏移直线<br/>&nbsp;&nbsp; Dim offsetobj As Variant<br/>&nbsp;&nbsp; <br/>&nbsp; offset =&nbsp;4500<br/>&nbsp;&nbsp;</font><font style="BACKGROUND-COLOR: #ffffff" face="Verdana"> offsetobj = lineobj1.offset(offset)<br/>&nbsp;&nbsp;&nbsp;</font><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp; '定义矩形阵列<br/>&nbsp;&nbsp; Dim numberofrows As Long<br/>&nbsp;&nbsp; Dim numberofcolumns As Long<br/>&nbsp;&nbsp; Dim numberoflevels As Long<br/>&nbsp;&nbsp; Dim distancebwtnrows As Double<br/>&nbsp;&nbsp; Dim distancebwtncolumns As Double<br/>&nbsp;&nbsp; Dim distancebwtnlevels As Double<br/>&nbsp;&nbsp; numberofrows =&nbsp;4<br/>&nbsp;&nbsp;&nbsp;numberofcolumns =&nbsp;4</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; numberoflevels = 1<br/>&nbsp;&nbsp; distancebwtnrows =&nbsp;4</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; distancebwtncolumns =&nbsp;4</font></p>
<p><font style="BACKGROUND-COLOR: #ffffff" face="Verdana">&nbsp;&nbsp; distancebwtnlevels = 1<br/>&nbsp;&nbsp;&nbsp;&nbsp; '创建对象阵列<br/>&nbsp;&nbsp; Dim retobj As Variant<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br/>&nbsp;&nbsp; retobj = lineobj.ArrayRectangular(numberofrows, 1, 1, distancebwtnrows, 1, 1)<br/>&nbsp;&nbsp; retobj = lineobj1.ArrayRectangular(1, numberofcolumns, 1, 1, distancebwtncolumns, 1)<br/><br/>&nbsp;&nbsp;&nbsp;<br/>&nbsp;&nbsp; ZoomAll</font></p>
页: [1]
查看完整版本: 大侠们怎样用VBA‘批量’朝X或Y 方向复制某个图形,哪位大侠能帮帮忙。小弟感激不尽