+ Reply to Thread
Results 1 to 6 of 6

Inserting a shape on many sheets and assigning a macros to the shape.

  1. #1
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Inserting a shape on many sheets and assigning a macros to the shape.

    Is there a way to insert a shape on the same location on many sheets and call a macros when this button is clicked? At one shot, I mean.

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Inserting a shape on many sheets and assigning a macros to the shape.

    Yes
    something like this

    Please Login or Register  to view this content.
    Last edited by humdingaling; 07-17-2017 at 03:33 AM. Reason: changed code slightly
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Re: Inserting a shape on many sheets and assigning a macros to the shape.

    Thanks a ton!
    One additional question. How do I position this shape correctly? Say, I want it between T3 and U4 in every sheet?
    Also,if I want some Text over it, would ActiveShape.Text = "Something" work?

    Also, what if I want to select a shape style?
    Last edited by hegdep; 07-17-2017 at 04:12 AM.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Inserting a shape on many sheets and assigning a macros to the shape.

    Please Login or Register  to view this content.
    how exactly do you want to select the shape?

    here's a list of shapes you can use
    https://msdn.microsoft.com/VBA/Offic...eration-office

  5. #5
    Registered User
    Join Date
    07-11-2017
    Location
    Landau
    MS-Off Ver
    2010
    Posts
    47

    Re: Inserting a shape on many sheets and assigning a macros to the shape.

    Thanks!
    I am referring to no other shape. Just applying a preset style(this is unique to each version of office, I presume)
    From the macros recording I tried out to do the same msoShapeStylePreset37

    Please Login or Register  to view this content.
    Logically, this should work.

    I'll try it out and let you know. Thanks a ton for your help!

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Inserting a shape on many sheets and assigning a macros to the shape.

    yeah there is a list of presets
    https://msdn.microsoft.com/en-us/lib...tyleindex.aspx

    descriptions of what they are wont help you much
    you are much better off just doing what you are doing, record macro to find the preset number

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Shape buttons - Switch background image of shape on click and exit - referenced jpg
    By ApatheticAndrew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-14-2015, 08:06 AM
  2. [SOLVED] Assigning macro to shape
    By drrazor in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-12-2014, 06:29 AM
  3. [SOLVED] How to add 3d bevel (Cool Slant) shape effect to Oval shape
    By Steve@Rugby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2013, 11:29 AM
  4. Replies: 13
    Last Post: 12-10-2013, 12:51 PM
  5. [SOLVED] Use a button to control a macro that inserts an image into a shape or resets the shape
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-13-2013, 04:41 PM
  6. Add command button to shape and change shape color on mouseover
    By maacmaac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-26-2012, 05:12 PM
  7. Replies: 0
    Last Post: 11-30-2012, 01:29 PM

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