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: 4
Default Exit when Cancel clicked.

Hi All

I have the code below which places user's inputs into the last-used cell in column C.

At present, if "Cancel" is clicked a blank row is added. I would like the routine to simply exit without doing anything if Cancel is clicked. I've googled these and have seen various ways of doing it but NOT in tandem with inputting to a cell.

Help! (Please)

'Determine emptyRow
emptyRow = ActiveSheet.Range("C7").End(xlDown).Row + 1

'Transfer information from form to Event Budget Inputs sheet
Cells(emptyRow, 3).Value = InputBox("Enter the new Category", "BizApp New Category")
Cells(emptyRow, 4).Value = InputBox("Enter the budgeted amount for the new Category", "BizApp New Category")

MsgBox "New Category added."
 
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
Cancel/Exit Sub Howard Excel Discussion (Misc queries) 3 December 16th 08 09:53 PM
Cancel an exit ranswrt Excel Programming 4 July 30th 08 03:08 PM
Input box to cancel sub when Cancel is clicked. PCLIVE Excel Programming 5 September 5th 06 03:19 PM
Cancel an application exit from VBA? helmekki[_98_] Excel Programming 3 October 28th 05 03:31 AM
How do I check if a user clicked the Print Cancel button joanne Excel Programming 0 September 5th 03 08:24 AM


All times are GMT +1. The time now is 09:46 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"