[Solved] Select multiple shapes in XLS
I'm trying to select an array of specific shapes in a sheet.
For example, assume there are some shapes in a sheet and you only want to select those matching the name in A1:A4.
Just using this works:
Code:
ActiveSheet.Shapes.Range(Array("img1","img2","img3","img4")).Select
I want to automate it and I wrote this but it doesn't work...
Code:
Dim my_range As Variant
Dim test() As String
ReDim test(4)
For i = 0 To 4
test(i) = Cells(i + 1, 1).Value
Next i
Set my_range = ActiveSheet.Shapes.Range(test)
my_range.Select
It says "The specified parameter has an invalid value". What am i doing wrong?
Re: Select multiple shapes in XLS
it can work if you dimension test as a variant array only
Re: Select multiple shapes in XLS
You are awesome! Thanks a lot.