Here's more detail on what's happening. Theres about 10k lines of code that I don't really want to wade through, so concept I think is well described below. I tried eval and some string functions but can't get there. There was a CallByName, but couldn't figure that out either.
This is solvable by select case but I don't want to have to test for every instance loaded into the array, would prefer not having that redundancy. I think original author wanted to save from using a conversion from a friendly name to VBA constant in the form, and I'm just picking it up to try and add the line option. Yes....this is excel.
Thanks...
Code:
Sub macro3()
Dim myChtO As ChartObject
Dim myCht As Chart
Dim mySrsC As SeriesCollection
Dim mySrs As Series
Set myChtO = ActiveSheet.ChartObjects("Chart1")
Set myCht = myChtO.Chart
Set mySrsC = myCht.SeriesCollection
'Array is created with string values of a bunch of VBA constants
dasArray = Array("<No Chg>", "msoLineSolid", "msoLineDash", "msoLongDash", _
"msoLineRoundDot", "msoLineSquareDot", "msoLineDashDot")
'Array is then loaded into a userform listbox
For l = 0 To UBound(dasArray, 1) ' widArray count of items
ListBox1.AddItem dasArray(l)
Next l
'Form is loaded, user selets which type of VBA constant they want to apply to something, say a graphed line
'user selects "msoLineDash"
AAA = ListBox1.Value
'now AAA = "msoLineDash"
'in this one line of code, I want to convert the chosen string from the form into a VBA constant value
mySrs.Format.Line.DashStyle = AAA
End Sub