LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default VBA code for MsgBox

For the following script I get an inputbox for which the user has to enter a
number:
Dim result As Long

result = Application.InputBox("Enter Number of Days which are in this
report( highest number of worksheets in document", "Days in Report")

Select Case result
Case 1
Columns("T:CJ").Select
Case 2
Columns("U:CJ").Select
Case 3
Columns("V:CJ").Select
Case Else
MsgBox "please enter a valid number"

End Select

I would like the macro to exit the sub when "cancel" is selected.
Can anyone help me with this?
 
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
HOW TO PUT MSGBOX CODE IN MACRO K[_2_] Excel Programming 1 May 4th 08 01:55 PM
Msgbox Code Help Please.... kmwhitt Excel Discussion (Misc queries) 5 September 21st 06 01:52 AM
Code for MsgBox TimN Excel Programming 3 September 5th 06 05:53 PM
VBA code using if then and msgbox snoopy Excel Discussion (Misc queries) 0 December 1st 05 08:48 PM
syntax for code in MsgBox()? Ouka[_4_] Excel Programming 2 July 20th 05 05:18 PM


All times are GMT +1. The time now is 06:16 AM.

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

About Us

"It's about Microsoft Excel"