+ Reply to Thread
Results 1 to 6 of 6

Three Sequence VBA

  1. #1
    Registered User
    Join Date
    04-17-2015
    Location
    Madison, WIsconsin
    MS-Off Ver
    2010
    Posts
    2

    Three Sequence VBA

    I would like to use a three sequence VBA double click where the first double click colors the cell, the second double click adds a check mark, and the third double click clears the process (blank cell with no check.) Attached is what I have right now. It goes through the first two steps, but does not clear on the third double click (remains colored with a check mark). Also, is there code for starting at R3 and going to infinity?

    Thanks.



    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If Not Intersect(Target, Me.Range("R3:R100000")) Is Nothing Then
    Cancel = True
    Application.EnableEvents = False
    If Target.Interior.ColorIndex = xlNone Then
    Target.Interior.ColorIndex = 44
    ElseIf Target.Interior.ColorIndex = 44 Then
    Target.Font.Name = "Wingdings"
    Target.Value = "ü"
    ElseIf Target.Value = "ü" Then
    Target.Interior.ColorIndex = 3
    Target.Value = ""
    End If
    End If
    FallThrough:
    Application.EnableEvents = True
    End Sub

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Three Sequence VBA

    Maybe if you reordered the steps

    Please Login or Register  to view this content.
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Three Sequence VBA

    This address the R3 through infinity question as well as clearing the cell out.

    Please Login or Register  to view this content.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Three Sequence VBA

    And - Welcome to the Forum!

  5. #5
    Registered User
    Join Date
    04-17-2015
    Location
    Madison, WIsconsin
    MS-Off Ver
    2010
    Posts
    2

    Re: Three Sequence VBA

    Thank you the welcome and sorry for the mistake on inserting the code.

    Thank you as well for the code correction. I am extremely new to this, so my next question is: I understand how to change the column and color for different columns to have a unique color, but how do I compile them so they all work (with different columns using its own unique color)?

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Three Sequence VBA

    You'd need to reference the Column Number with the ColorIndex you want for that column - can you post an example?

+ 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. [SOLVED] Creating a sequence based on numbers in one column and adding "01,02..." to a new sequence
    By JCR1968 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-05-2013, 08:06 AM
  2. Replies: 0
    Last Post: 12-12-2012, 06:39 PM
  3. [SOLVED] min and max in a sequence
    By bill gras in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 09-13-2010, 10:44 AM
  4. Sequence Value
    By ChadJerklian in forum Excel General
    Replies: 4
    Last Post: 08-09-2007, 01:15 AM
  5. Next in the sequence
    By Mr M Walker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2005, 02:06 PM

Tags for this Thread

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