c# converting select case VBA to c# SWITCH

Posted by herrow on Stack Overflow See other posts from Stack Overflow or by herrow
Published on 2011-01-05T20:29:24Z Indexed on 2011/01/05 20:54 UTC
Read the original article Hit count: 127

Filed under:
|

i have some vba code that i need to convert to c#

Select Case letter0
    Case "A01"
    Cells(rownum, 2).Value = "1"
    Case "B01"
    Cells(rownum, 2).Value = "2"
    Case "C01"
    Cells(rownum, 2).Value = "3"
    Case "D01"
    Cells(rownum, 2).Value = "4"
    Case "E01"
    Cells(rownum, 2).Value = "5"
    Case "F01"
    Cells(rownum, 2).Value = "6"
    Case "G01"
    Cells(rownum, 2).Value = "7"
    Case "H01"
    Cells(rownum, 2).Value = "8"
    Case "A02"
    Cells(rownum, 2).Value = "9"
    Case "B02"
...
..

i understand how to do a switch on this, but is there an easier method?

i will not be checking CELLS(rownum.........) instead of will be doing switch(somestring)

is there an easier way to do this than explicitly write every single case?

© Stack Overflow or respective owner

Related posts about c#

Related posts about vba