I have a sheet with several different "Shapes" including lines, buttons, etc. I want to select the shapes by type programmatically. My attempts so far included the following:
For Count = 1 To ActiveSheet.Shapes.Count
If ActiveSheet.Shapes(Count).Name Like "Line*" Then
line_array = line_array & Count & ", "
End If
Next Count
line_array = Left(line_array, Len(line_array) - 2)
ActiveSheet.Shapes.Range(Array(line_array)).Select
In the above code I was hoping to concatenate a list of Shapes with the word "Line" in the object name, but the error occurs in the concatenated array in the last line of code, so I was barking up the wrong tree.
Does anyone know how to select objects by type, rather than selecting all the objects on the sheet?
For Count = 1 To ActiveSheet.Shapes.Count
If ActiveSheet.Shapes(Count).Name Like "Line*" Then
line_array = line_array & Count & ", "
End If
Next Count
line_array = Left(line_array, Len(line_array) - 2)
ActiveSheet.Shapes.Range(Array(line_array)).Select
In the above code I was hoping to concatenate a list of Shapes with the word "Line" in the object name, but the error occurs in the concatenated array in the last line of code, so I was barking up the wrong tree.
Does anyone know how to select objects by type, rather than selecting all the objects on the sheet?
Last edited: