Results 1 to 3 of 3

Thread: [Solved] Select multiple shapes in XLS

Threaded View

  1. #1

    Thread Starter
    Addicted Member Fonty's Avatar
    Join Date
    May 2006
    Location
    New York
    Posts
    173

    Resolved [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?
    Last edited by Fonty; Feb 26th, 2012 at 09:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width