Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2016-09-15
7
Medium Priority
?
56 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 2
7 Comments
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41800748
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 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 41800755
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
ID: 41800757
Thanks for your quick response it can appear like this.

After  ""  ,   "DONE"

The rest can follow
 "NOW",   "THEN",    "ZLAST"
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 49

Expert Comment

by:Martin Liss
ID: 41800760
Then see my code above.
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41800767
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
ID: 41813438
Work's great thanks a mil Martin Liss
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 41813760
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

722 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