Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
input box cancel button
I am using an input box to get a value for changing the axis on every
chart in a worksheet. I works fine but when cancel is hit I get a strange result. how can Improve the code below so a cancel hit will return to the worksheet with no change Sub set_axis() Dim ch As ChartObject mindepth = Application.InputBox(prompt:="Please Enter The Top Depth for the Plot") maxdpeth = mindpeth + 60 For Each ch In ActiveSheet.ChartObjects With ch.Chart.Axes(xlValue) .MinimumScale = mindepth .MaximumScale = mindepth + 60 .ReversePlotOrder = True .CrossesAt = mindepth End With Next ActiveSheet.Name = "Core Plot " & mindepth & "m" End Sub Cheers Ian |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
input box cancel button
Ian,
One way If Len(mindepth) 0 then * your code * End If This works even if something is entered into the input box. -- sb "Ian Mangelsdorf" wrote in message om... I am using an input box to get a value for changing the axis on every chart in a worksheet. I works fine but when cancel is hit I get a strange result. how can Improve the code below so a cancel hit will return to the worksheet with no change Sub set_axis() Dim ch As ChartObject mindepth = Application.InputBox(prompt:="Please Enter The Top Depth for the Plot") maxdpeth = mindpeth + 60 For Each ch In ActiveSheet.ChartObjects With ch.Chart.Axes(xlValue) .MinimumScale = mindepth .MaximumScale = mindepth + 60 .ReversePlotOrder = True .CrossesAt = mindepth End With Next ActiveSheet.Name = "Core Plot " & mindepth & "m" End Sub Cheers Ian |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Input Box Cancel | Excel Discussion (Misc queries) | |||
Exit Code Upon Cancel On Type 8 Input Box | Excel Discussion (Misc queries) | |||
Input Box - CANCEL | Excel Worksheet Functions | |||
cancel input | Excel Discussion (Misc queries) | |||
message box without ok or cancel button | Excel Discussion (Misc queries) |