Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 576
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Box Cancel Jase Excel Discussion (Misc queries) 2 September 15th 08 11:42 PM
Exit Code Upon Cancel On Type 8 Input Box FARAZ QURESHI Excel Discussion (Misc queries) 2 March 31st 08 09:22 AM
Input Box - CANCEL Danny Excel Worksheet Functions 6 December 1st 06 02:15 AM
cancel input ME @ Home Excel Discussion (Misc queries) 1 February 22nd 06 09:49 AM
message box without ok or cancel button Subash Excel Discussion (Misc queries) 1 October 18th 05 10:38 AM


All times are GMT +1. The time now is 04:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"