Can anyone please help me to write or modify my macro.
Actually my Current Macro help me to do Sort by in the Chart Object,but only if i Select any one Field if more than one field appears or a single field appears,
I want a macro which should help me to sort the Objects by Default if only one field apperas in Sort by Object.
Ex:
I have a list box as Measures, if i select any field in Measures then Some fields come in my new Table as Sort by as Caption, If i Select any 1 Sort by Fields it Does the Sorting but if Only one Fields Come in the Sort By Caption then I have to Selct it to do the process but i Want it to be By Default do Soring in Chart if Only one Field Apperas as Sort By.
My Current Macro is :
for iloop=0 to objML.count-1
if (objML.Item(iloop).Text=ActiveDocument.GetVariable("ML_Sort_UA2").GetContent.String) then
sortBY1=iloop
exit for
end if
next
a=0
if(sortBY1<>"") then
Mnu2 = objM.Item(sortBY1).Text
end if
for j=0 to objM.count-1
if(a=0)then
chart.AddExpression Mnu2
set p = chart.GetProperties
set exps = p.Expressions.Item(0).Item(0).Data.ExpressionVisual