I add a textbox in the lower right hand corner of a chart for supplemental information. This code snippet works:
where "peak detect" is my source page for the formula. Look at the last two lines. Why do I have to do this? For some reason I have to select the shape object to set the formula. I can't find any other way to set the formula property of a textbox.Code:Set tb = ActiveChart.Shapes.AddTextbox _ (msoTextOrientationHorizontal, _ ActiveChart.ChartArea.width - 125, _ ActiveChart.ChartArea.Height - 22, _ 124, _ 21) With tb .Fill.BackColor.RGB = RGB(225, 225, 225) .TextFrame.HorizontalAlignment = xlHAlignCenter .TextFrame.VerticalAlignment = xlVAlignCenter End With 'textbox "frame" tb.Select Selection.Formula = "='peak detect'!$I$2"
Thank you




Reply With Quote