+ Reply to Thread
Results 1 to 9 of 9

Looping through Shapes to change transparency

  1. #1
    Registered User
    Join Date
    03-30-2013
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2007
    Posts
    41

    Looping through Shapes to change transparency

    Hello,

    I'm attempting to write some code that will loop through several shapes and change their transparency based on what a user selects on an interface.

    Any suggestions on how to go about doing this?

    Thanks!
    Joe

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Looping through Shapes to change transparency

    Hi,

    place at least one rectangle on the active worksheet and run this:
    Please Login or Register  to view this content.
    Regards
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    03-30-2013
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Looping through Shapes to change transparency

    tehneXus,

    Thanks so much for your reply! I tried the code, and it worked. However, I am trying to alter the code so that only the transparency of shapes in a particular group will change when the selection is made. Could you help me out with how to adapt the code so that it will change the group rather than all of one particular shape?

    Thanks!
    Jackson

  4. #4
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Looping through Shapes to change transparency

    Hi,

    then you'll have to name your shapegroups manually (select the group and enter the name into the name box) and check for specific names in the code, like here:
    Please Login or Register  to view this content.
    This will set the transparency for the entire group, if you want to do this only for specific shapes in a group let me know.

    Regards

  5. #5
    Registered User
    Join Date
    03-30-2013
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Looping through Shapes to change transparency

    tehneXus,

    Thanks again! That worked well. One final question: I want the macro to automatically fire when the cell is changed that has the percentage for the transparency. How can I set this up.

    I greatly appreciate your help!
    Jackson

  6. #6
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Looping through Shapes to change transparency

    Hi,

    please copy this into the WORKSHEET module of the worksheet that contains the cell which will be changed and write somthing into A1:
    Please Login or Register  to view this content.
    Regards

  7. #7
    Registered User
    Join Date
    03-30-2013
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Looping through Shapes to change transparency

    tehneXus,

    Thanks again for your help. I'm trying the following code:

    Please Login or Register  to view this content.
    I'm hoping to fire the macro whenever I manually change the percentage on the worksheet. It's not working for some reason. Any suggestions?

    Thanks again,
    Joe

  8. #8
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Looping through Shapes to change transparency

    Hi,

    What is "[cell_trans]" ?

    Please remove the "End if" or insert a line break after "Then"

    Regards

  9. #9
    Registered User
    Join Date
    03-30-2013
    Location
    Chattanooga, TN
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Looping through Shapes to change transparency

    tehneXus,

    Thanks so much for your help! I looked over this with a co worker and was able to get it to work. You were very helpful along the way!

    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