看板 Visual_Basic 關於我們 聯絡資訊
我有一段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 noworneverev:轉錄至看板 Office 05/20 19:06