Solved

If i keep on clicking i want to see more than two options.

Posted on 2016-09-15
7
38 Views
Last Modified: 2016-09-24
Hello Experts Exchange, I want to add more words to these code module. The code module show two words at this time, "" and "DONE" want to add "NOW"     "THEN"    and   "ZLAST" to the one that i currently have. So that when i keep on clicking on the button i would see ""  ,   "DONE",    "NOW",   "THEN",    "ZLAST". A total of five words, see one word every time i click on it. Thanks again Experts Exchange community for your help and time.

If UCase(Cells(ActiveCell.Row, "H")) = "DONE" Then
        Cells(ActiveCell.Row, "H") = ""
        
    Else
        Cells(ActiveCell.Row, "H") = "DONE"

Open in new window

0
Comment
Question by:Omar Hernandez
  • 5
  • 2
7 Comments
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
Is there an order that you want them to appear?

Would you instead just like the user to choose from a dropdown list?
0
 
LVL 45

Accepted Solution

by:
Martin Liss earned 500 total points
Comment Utility
Is this what you want? Note that in order to get it to change from one to another more than once, you need to select a different cell and the select the one in column H.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case UCase(Cells(ActiveCell.Row, "H"))
    Case ""
        Cells(ActiveCell.Row, "H") = "DONE"
    Case "DONE"
        Cells(ActiveCell.Row, "H") = "NOW"
    Case "NOW"
        Cells(ActiveCell.Row, "H") = "THEN"
    Case "THEN"
        Cells(ActiveCell.Row, "H") = "ZLAST"
    Case "ZLAST"
        Cells(ActiveCell.Row, "H") = ""
End Select

End Sub

Open in new window

0
 

Author Comment

by:Omar Hernandez
Comment Utility
Thanks for your quick response it can appear like this.

After  ""  ,   "DONE"

The rest can follow
 "NOW",   "THEN",    "ZLAST"
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
Then see my code above.
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
You may like this better.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Select Case UCase(Cells(ActiveCell.Row, "H"))
    Case ""
        Cells(ActiveCell.Row, "H") = "DONE"
    Case "DONE"
        Cells(ActiveCell.Row, "H") = "NOW"
    Case "NOW"
        Cells(ActiveCell.Row, "H") = "THEN"
    Case "THEN"
        Cells(ActiveCell.Row, "H") = "ZLAST"
    Case "ZLAST"
        Cells(ActiveCell.Row, "H") = ""
End Select
Application.EnableEvents = False
Target.Offset(1, 0).Activate
Application.EnableEvents = True
End Sub

Open in new window

0
 

Author Closing Comment

by:Omar Hernandez
Comment Utility
Work's great thanks a mil Martin Liss
0
 
LVL 45

Expert Comment

by:Martin Liss
Comment Utility
You're welcome and I'm glad I was able to help.

If you expand the “Full Biography” section of my profile you'll find links to some articles I've written that may interest you.

Marty - Microsoft MVP 2009 to 2016
              Experts Exchange MVE 2015
              Experts Exchange Top Expert Visual Basic Classic 2012 to 2015
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now