+ Reply to Thread
Results 1 to 7 of 7

VBA: Using Symbols

Hybrid View

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    4

    VBA: Using Symbols

    I have a problem, when I have if-else statements that specifies the value of my combo-box, I encountered error on symbols (greek letter raw to be specific)
    It only displyed ? as seen in the incomplete program. Any help would be appreciated.



    Private Sub ComboBox1_Change()
    
    If ComboBox1.Value = "Pa" Then
    
    
    
    ElseIf ComboBox1.Value = "Pb" Then
    
    
    
    ElseIf ComboBox1.Value = "G" Then
    
    
    
    ElseIf ComboBox1.Value = "R" Then
    
    
    
    ElseIf ComboBox1.Value = "T" Then
    
    
    
    ElseIf ComboBox1.Value = "M" Then
    
    
    
    ElseIf ComboBox1.Value = "a" Then
    
    
    
    ElseIf ComboBox1.Value = "Pb" Then
    
    
    
    ElseIf ComboBox1.Value = "?a" Then
    
    
    
    
    
    
    
    End Sub
    Last edited by Cutter; 07-27-2012 at 09:00 AM. Reason: Added code tags

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VBA: Using Symbols

    Drop the Greek symbol into a cell on a hidden sheet, and check against the cell value.

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA: Using Symbols

    By the way, I tried!! But I think I will asked a stupid question... I don't know where to view the cell value.
    I just know the code in MACRO... eg sheets("Sheet1").Cell(1,1).Value however, I don't know how to display it. I tried displaying it in the msgbox, however, no value appeared.

    Many thanks Bob

  4. #4
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: VBA: Using Symbols

    It won't show in a message box, VBA has a problem with Unicode. My suggestion was to use in the comparison against the combobox value.

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA: Using Symbols

    Ok!! Got you point!!

    ElseIf ComboBox1.Value = "T" The

    ElseIf ComboBox1.Value = ActiveSheet.Range("S2").Value Then


    My symbol is located at cell S2 Thanks for the reply.

    Cheers,
    Christopher Choa

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: VBA: Using Symbols

    @ christopher.choa

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

  7. #7
    Registered User
    Join Date
    07-27-2012
    Location
    Philippines
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: VBA: Using Symbols

    @cutter: ok, Ill do that on my next post!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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