+ Reply to Thread
Results 1 to 2 of 2

Programming with Autoshapes

  1. #1
    Registered User
    Join Date
    08-14-2006
    Posts
    29

    Programming with Autoshapes

    Hello,

    I am having some trouble with shapes. I am currently building huge javascript arrays based on cell content from excel. The trouble I am having is each time I paste new data over the old data in my spreadsheet, Excel thinks it would be really useful to rename all of the shapes in the sheet! See, what the code does is to take three pieces of data, a postcode, a manufacturer and the result of the resulting query. If the cell has a red star in it, my code appends a html img src reference to a gif image of a red star, to the javascript array element. In a nutshell, I need to know if I can stop excel from renaming all the shapes each time new data is pasted into the sheet. Failing that, can you reference the shapes collection via something other than names? This way I could simply rename all the shapes myself. The code at the moment looks at the names of the shapes in the sheet which are usually named "AutoShape" & i. Any ideas much appreciated.

    Cheers
    Joe
    Last edited by LFCFan; 10-10-2006 at 11:36 AM.

  2. #2
    Registered User
    Join Date
    08-14-2006
    Posts
    29

    Figured it out

    Sub renameShapes()

    For sCount = 1 To Sheets(1).Shapes.Count
    Sheets(1).Shapes(sCount).Select
    Selection.Name = "AutoShape " & sCount
    Next

    End Sub

    Cheers anyway
    Joe

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1