Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 15th, 2012, 03:24 PM
Authorized User
Points: 43, Level: 1
Points: 43, Level: 1 Points: 43, Level: 1 Points: 43, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Sep 2012
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dealing with Shapes

Does anyone know of any good primers that show you how to deal with shapes? I have been hobbling together code by recording Macros but I am unable to do a few key things.

I am trying to refer to a specific shape on the sheet that I did not create. Is there someway to pull the shape out of the collection and reference it?

I've tried:

Reply With Quote
  #2 (permalink)  
Old January 16th, 2013, 11:50 PM
Registered User
Points: 3, Level: 1
Points: 3, Level: 1 Points: 3, Level: 1 Points: 3, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Addressing shapes


I'm not sure I know exactly what you mean, but here goes:

If you have a shape called "Button1" on the active sheet and you want to select it, you would go:

Other things you might do would include:
ActiveSheet.Shapes("Button1").Width = 35.5
(similar for height, top and left)

You find out the name of the shape by selecting it and looking in the name box just above the column header for Column A (the same place where you see Range names. You can change the names of shapes in there too.

If you enter a standard shape via Insert .. Shapes, it will have a default name like "Rectangle1" or "Isosceles Triangle23". As I mentioned above, you can change these default names, by selecting the object and overtyping the existing name in the Name Box. BUT you have to present <Enter> (not <Return>) to confirm the name; otherwise it won't stick.
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
.Shapes.AddFormControl(xlListBox Wall st Guru Excel VBA 0 March 18th, 2006 08:36 AM
Drawing Shapes cbulutlar Javascript 2 March 6th, 2006 02:25 PM
drawing shapes (advanced) FFinn Javascript How-To 1 September 28th, 2005 10:19 AM
Dragging shapes rajanikrishna Pro VB 6 0 October 19th, 2004 08:35 PM
saving images and shapes together saiyedriyaz BOOK: Beginning Java 2 1 June 12th, 2004 08:23 AM

All times are GMT -4. The time now is 09:54 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.