Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi.
I have a graph in Excel which is populated with data based upon a selection from a drop down box. For some of the selections though there is no data and an error message comes up and the graph does not display properly. I want to (using VBA) have a command that executes if there is no data to populate the graph and temporarily display a text box over the graph to say data unavailable - that way the graph does not look untidy. I have put together some code - which is not working - and wondered if anyone can give me some advice to make it work and also to supress the error message. The code I have started is contained in the ThisWorkbook object and is as follows: Private Sub Workbook_SheetCalculate(ByVal Sh As Object) If Sheets("TIA").Range("A38") = 0 Then If Sh.Name = "TIA" Then Worksheets("TIA Analysis").Select ActiveSheet.Shapes.AddTextbox(msoTextOrientationHo rizontal, 195, 18, 425, 268).Select Selection.Characters.Text = "DATA UNAVAILABLE" Selection.HorizontalAlignment = xlCenter With Selection.Characters.Font .Name = "Arial" .FontStyle = "Regular" .Size = 28 .Strikethrough = False .Superscript = False .Subscript = False .OutlineFont = False .Shadow = False .Underline = xlUnderlineStyleNone .ColorIndex = 3 End With End If End If End Sub Any help would be welcomed. Thanks. Liz. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Show shape on cell select, Hide shape when cell is deselected | Excel Programming | |||
Move shape, object, pic to center of new cell based on cell value | Excel Programming | |||
draw shape based on cell values | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming | |||
Deleting a shape and the cell contents the shape is in. | Excel Programming |