Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using Arrays to select Shapes
I am having a problem building and then using an Array. Can anyone show me the errors of my way?
The following routine is called by another routine Sub BuildArray(MyName) On Error GoTo NotFound If MyArray = "" Then MyArray = MyName Else MyArray = MyArray & """, """ & MyName End If Exit Sub NotFound: Msg = "Selection is not on this Sheet." Title = "Not Found" Style = vbOKOnly Response = MsgBox(Msg, Style, Title) MyContinue = "No" Exit Sub End Sub MyArray looks OK (i.e. I3890 150, I3890 160, I3890 170). Then the calling routine tries to use the array as follows: ¦ Worksheets(MySheet).Select Worksheets(MySheet).Shapes.Range(Array(MyArray)).S elect Selection.Cut End Sub But the result is Run-time error 1004. The item with the specified name wasnt found. If I substitute the actual value of MyArray (i.e. I3890 150, I3890 160, I3890 170) in the calling program, it runs just fine. Whats with that? Your assistance is greatly appreciated. Don |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2007 - Select Multiple Shapes | Excel Discussion (Misc queries) | |||
Select and Move Cursor Shapes | New Users to Excel | |||
How Do I ... select multiple shapes in Excel 2007 (similar to 2003 | Excel Discussion (Misc queries) | |||
When drawing shapes in excel the shapes keep disappearing | Excel Discussion (Misc queries) | |||
Using arrays to select a series of cells | Excel Discussion (Misc queries) |