Private Sub ComboBox1_Change()
If Me.ComboBox1.Text <> "" Then
If Me.OptionButton1 = True Then
Me.Label1 = Left(Me.ComboBox1.Text, Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text) - 1)
'Me.Label1 = Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text)
Else
'Me.Label1 = Right(Me.ComboBox1.Text, Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text) + 1)
Me.Label1 = Right(Me.ComboBox1.Text, Len(Me.ComboBox1.Text) - (Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text) + 2))
End If
Else
Exit Sub
End If
End Sub
If Me.ComboBox1.Text <> "" Then
If Me.OptionButton1 = True Then
Me.Label1 = Left(Me.ComboBox1.Text, Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text) - 1)
'Me.Label1 = Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text)
Else
'Me.Label1 = Right(Me.ComboBox1.Text, Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text) + 1)
Me.Label1 = Right(Me.ComboBox1.Text, Len(Me.ComboBox1.Text) - (Application.WorksheetFunction.Find(" -", Me.ComboBox1.Text) + 2))
End If
Else
Exit Sub
End If
End Sub
No comments:
Post a Comment