Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a multibox, there is 100 value, What I want, Whatever value is selected there, That is my dimesion and I want to chage the color of background of selected dimension in my Multibox.
Please correct this macro so I can use the same
Sub GetSelected()
x=ActiveDocument.GetSheetObject("MB04").GetRelevantSelections
COLUMN_NAME=x(0)
Cstr(COLUMN_NAME)
id=Right(Cstr(COLUMN_NAME),len(Cstr(COLUMN_NAME))-12)
set chart = ActiveDocument.GetSheetObject("CH28")
set cp = chart.GetProperties
set expr = cp.Expressions.Item(0).Item(0).Data
set bce = expr.AttributeExpressions.BkgColorExp
bce.Definition.v = "if(COLUMN_NAME='STATE_CD', red(), yellow())"
chart.SetProperties cp
End Sub
Thanks
Generally this macro worked - where is the problem? I suggest another way to extract the selected value like this:
id=x(0)
id = mid(id, instr(id, chr(9)))
'msgbox id
Furthermore it don't need a macro for this. per field-functions like getfieldselections(), getselectedcount() directly in the attribute expression could the same achieved.
- Marcus