0

First i don't know if this will be right forum but i know its related somehow?
I'm using excel developer visual basic and i have a combobox

Dim x As String
Dim y As String

    x = "O15"           ' range


With ComboBox1

    If .Text = "" Then
        Range(x) = ""
    ElseIf .Text = "Level 4" Then
        Range(x) = "12%"
        Range("CountLevel4") = Range("CountLevel4") + 1
    ElseIf .Text = "Level 5" Then
        Range(x) = "50%"
        Range("CountLevel5") = Range("CountLevel5") + 1
    ElseIf .Text = "Level 6" Then
        Range(x) = "100%"
        Range("CountLevel6") = Range("CountLevel6") + 1
    ElseIf .Text = "Level 7" Then
        Range(x) = "100%"
        Range("CountLevel7") = Range("CountLevel7") + 1
    ElseIf .Text = "Lost" Then
        Range(x) = "0%"
        Range("CountLost") = Range("CountLost") + 1
    End If

my code is that everytime the combo box change its text it will add + 1 to a specific Column
my problem is let say that the combobox is a level 4 then i change it to level 5 i want it to deduct 1 to level 4 and add it 1 to level 5.

2
Contributors
3
Replies
5
Views
4 Years
Discussion Span
Last Post by tinstaafl
0

You might want to consider using .SelectedText instead of .Text, if .Text isn't giving you the right result.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.