View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] evets.snomis@gmail.com is offline
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."