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: 208
Default Popup for cell change

I'm using Excel 2000. I have a spreadsheet where a user enters numbers for
debits and credits. I'd like to have a popup appear when the user enters a
value incorrectly - ie, debits have to be entered as a positive number,
credits have to be negative.

Also, is there a way to erase or undo the previous entry?

I'm thinking the worksheet_change event is needed here, but what I've tried
doesn't seem to work:

Private Sub Worksheet_Change(ByVal Target As Range)
if ActiveCell.Offset(0, -1).Value = "Debit" and Range("ActiveCell.Value
<1 Then
MsgBox "The number entered needs to be positive"
Elseif ActiveCell.Offset(0, -1).Value = "Credit" and
Range("ActiveCell.Value 1 Then
MsgBox "The number entered needs to be negative"
End If
End Sub

Thanks for any and all help.



--
Craig
 
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
Showing known cell reference in a popup Colin Hayes Excel Worksheet Functions 4 May 31st 10 04:19 PM
Automating change via popup to a column of numbers Colin Hayes Excel Worksheet Functions 0 May 28th 09 02:59 PM
User entry in cell creates popup Bryan Excel Discussion (Misc queries) 3 January 5th 09 08:34 PM
If values are'nt entered in cell a popup window comes up?? pano Excel Worksheet Functions 5 February 14th 07 02:30 PM
How do I create a popup window based on a cell value? bumper338 Excel Discussion (Misc queries) 2 November 28th 06 03:05 PM


All times are GMT +1. The time now is 10:06 PM.

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"