manipulating displayed pictures: can I rename the various Shapes to make coding easier.

  • Thread starter Thread starter B J W
  • Start date Start date
B

B J W

I have a spreadsheet, used as a data collection form, which incidentally
displays a corporate division logo.

I would like the logo displayed to be dependent on a particular value
entered, a value identifying the corporate division.

I can record a macro, which changes which logo is in front, and in the
process discovered the names of particular logo graphics (e.g.
activesheet.shape("picture 10").select)

For each logo graphic, I have recorded code that puts that graphic on top of
a blank gif, which in turn covers all the other graphics. I have a Select
Case statement, which determines, on the basis of entered data, which code
runs, and therefore which logo graphic shows on the page.

I was wondering if there is a way to rename "picture 10" to something more
meaningful. It sure would make the code easier to read.

Is it possible to give graphics, names, and to manipulate those graphics, by
name?

Is there a better way than just having all possible graphics in place, and
manipulating the layering to determine which one shows?
 
Hi B J,
I was wondering if there is a way to rename "picture 10" to something more
meaningful. It sure would make the code easier to read.

Sub Tester02()

ActiveSheet.Pictures("Picture 10").name = "CompanyABC_Logo"
End Sub
 
Manually, you can select the picture (when it's visible) and then type the new
name in the namebox (to the left of the formula bar).

Remember to hit enter when you're done typing the new name.

(and your approach sounds as reasonable as any--if the other pictures don't add
too much to the size of your workbook.)

If you don't want to share those other pictures (even though they're hidden),
you could just import a picture from a common folder each time you need one.
 
Dave Peterson said:
Manually, you can select the picture (when it's visible) and then type the
new
name in the namebox (to the left of the formula bar).

I knew that there was a place in the interface to do it -- I just did not
cotton to that.

I used the other poster's suggestion for re-naming in VBA, but I will
remember the namebox in the future.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top