Results 1 to 14 of 14

Commandbutton loses transparency

Threaded View

  1. #8
    Registered User
    Join Date
    11-04-2014
    Location
    India
    MS-Off Ver
    2007
    Posts
    85

    Re: Commandbutton loses transparency

    Quote Originally Posted by freeofcost View Post
    I am going to spend time on understanding how the code is getting executed and then going to come up with a different scenario and do it myself. I will come back to you if I need help. Thank you so much.
    What I understood so far is that the application.caller with an offset detects the cell and puts a number '1' in it and then the sum function is used to calculate how many cells contain number '1' and match with the condition in cell G2. Wow! thats a wonderful logic (I hope I have understood correctly)

    Now if I move Shapes or put the buttons horizontally, the code stops working.... I guess because of SET offsets and the range Range("B2:B8"). I have changed the scenario a bit and altered the code. however, it does not work and only one column is getting selected. I think I have not understood the TopLeftCell property well.

    Can you please have a look at the code? I have updated the attached file with the instructions. There are two sheets in it "Working" and "Not Working"

    Thank you
    Sub ertertNotWorking()
    With ActiveSheet.Shapes(Application.Caller).TopLeftCell.Offset(-2, 0)
        If .Interior.Color = vbGreen Then
            .Interior.Color = xlNone: .Offset(-1, 0).ClearContents
        Else
            If Range("F2").Value = "Yes" Then
                With Range("B3:D5")
                    If WorksheetFunction.Sum(.Value) >= Range("G2").Value Then _
                       .Interior.Color = xlNone: .Offset(-1, 0).ClearContents
                End With
                .Interior.Color = vbGreen: .Offset(-1, 0).Value = 1
            End If
        End If
    End With
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ListBox Transparency
    By jquintana83 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2014, 05:12 AM
  2. Commandbutton in userform to execute code based on a previous commandbutton choice?
    By michaeljoeyeager in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-20-2012, 03:28 PM
  3. Transparency for interior color?
    By reloader in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-06-2006, 09:40 AM
  4. [SOLVED] combo box transparency
    By John Davies in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-28-2005, 12:05 AM
  5. [SOLVED] I can not set transparency into chart
    By Stefano in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-10-2005, 11:06 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