Fw: [VBA ] VB轉VBA ReDim Preserve 問題
※ [本文轉錄自 Visual_Basic 看板 #1P7yCucY ]
作者: noworneverev (小朋友) 看板: Visual_Basic
標題: [VBA ] VB轉VBA ReDim Preserve
時間: Sat May 20 12:16:46 2017
我有一段VB的程式碼想轉成VBA遇到一點困難
VB的程式碼如下:
'Group the line and the textbox
Dim MidObj() As Object
ReDim Preserve MidObj(2)
MidObj(0) = shapeBeg.Name
MidObj(1) = connector1.Name
app.ActiveSheet.Shapes.Range(MidObj).Group()
目的是要群組一個線條跟一個文字方塊,這個是正確的
VBA現在我寫的是:
ReDim Preserve MidObj(2)
MidObj(0) = GroupShapeBeg1
MidObj(1) = GroupShapeBeg2
ActiveSheet.Shapes.Range(Array(GroupShapeBeg1, GroupShapeBeg2)).Select
Selection.ShapeRange.Group.Select
我的想法是把原本shapeBeg.Name、connector1.Name在VBA裡先分別宣告給
GroupShapeBeg1與GroupShapeBeg2,再把它們群組起來,可是沒有作用QQ
請求大大幫忙看看哪裡有問題,謝謝
--
An Excel Add-in for audiors and accountants
http://tickmark.tw/
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 111.253.30.169
※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1495253816.A.9A2.html
※ 發信站: 批踢踢實業坊(ptt.cc)
※ 轉錄者: noworneverev (111.253.30.169), 05/20/2017 19:06:53
→
05/20 22:04, , 1F
05/20 22:04, 1F
→
05/20 22:06, , 2F
05/20 22:06, 2F
Office 近期熱門文章
PTT數位生活區 即時熱門文章