+ Reply to Thread
Results 1 to 8 of 8

Changing Shapes line color using VBA

  1. #1
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Changing Shapes line color using VBA

    I just can’t seem to figure this one out. I’m using Excel 2007.
    And I have 3 different Rounded Rectangle Shapes on a single worksheet named Cover Page. I’m trying to figure out how to change the line color using VBA with option buttons. Here’s what I have so far. Option button 6 refers to a macro that opens a color chart for custom selection. Any suggestion would be greatly appreciated.


    Please Login or Register  to view this content.
    Last edited by ABabeNChrist; 11-23-2010 at 10:59 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Changing Shapes line color using VBA

    More like

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Changing Shapes line color using VBA

    Thank you Andy
    I tried using a similar piece of code earlier that I found searching the internet, but it was without (1) and of course I had no success. I made changes to my code like so and it now works great.

    May I ask a couple quick questions?
    1. If I were to add a Rectangle to this same sheet, what would I need to add to include this also?
    2. This one might be the tricky one. Is it possible to add a Shape.Glow 11Point

    Here's a view of the changes I made.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Changing Shapes line color using VBA

    I figured out how to select more than 1 type of shape by using array approach.
    I changed this part

    Please Login or Register  to view this content.

    With this

    Please Login or Register  to view this content.
    And now I know how to include additional shapes if needed. I still haven’t figured out how to use Glow?

  5. #5
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Changing Shapes line color using VBA

    The object model is not complete for the Glow formatting.

    But the glow will be solid as you can not set the transparency.

    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Changing Shapes line color using VBA

    Hi Andy
    I was able to get the code to work when using this approach
    Please Login or Register  to view this content.
    But when I try to select more than one shape at a time using an array I get an error Run-time error ‘13’, type mismatch

    Please Login or Register  to view this content.
    Any idea what it might be?

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Changing Shapes line color using VBA

    shpTemp is a shape object. The returned object type from the .Range method is a ShapeRange

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Changing Shapes line color using VBA

    Thank you so much for your assistance Andy
    Its works great.

+ 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