Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Cell Change Alert

Hi,

I have an Excel worksheet called Controls. I need a popup alert that says
"Warning: Cell Changed." when cell H9 changes from 1 to 0 or from 0 to 1.

I'm not a VBA expert. Any suggestions on the code?

Thanking you,

GBExcel.

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Cell Change Alert

The following does **exactly** what you asked, but I can't help feeling
there is more to your question and/or sheet setup than you have told us.

Right click the tab at the bottom of the worksheet where you want this
functionality at, select View Code from the popup menu that appears and then
copy/paste the following into the code window that appears...

'*************** START OF CODE ***************
Dim OldValue As Variant

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$H$9" Then
Select Case Target.Value
Case 0
If OldValue = 1 Then MsgBox "Warning: Cell Changed."
Case 1
If OldValue = 0 Then MsgBox "Warning: Cell Changed."
End Select
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
OldValue = Target.Value
End Sub
'*************** END OF CODE ***************

--
Rick (MVP - Excel)


"GBExcel via OfficeKB.com" <u55438@uwe wrote in message
news:9edf2719c0b8e@uwe...
Hi,

I have an Excel worksheet called Controls. I need a popup alert that says
"Warning: Cell Changed." when cell H9 changes from 1 to 0 or from 0 to 1.

I'm not a VBA expert. Any suggestions on the code?

Thanking you,

GBExcel.

--
Message posted via http://www.officekb.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Cell Change Alert

You are quite right and my ignorance shines through. Your code works
perfectly, but my logic does not.

The setup is this: I have an option button with two options on H9. Selecting
these options causes the change in values from 0 to 1 or 1 to 0 in cell H9.
(Actually, it is 1 to 2, but let's stay with 0 and 1 for consistency's sake.)

So selecting the option button should trigger the number change and the alert
- or at least that is what my logic thought.

As it stands now, if I select H9 with a mouse click and type in a 1 or 2 the
alert appears. If I use the option button it does not.

Appreciate your help.

GBExcel

Rick Rothstein wrote:
The following does **exactly** what you asked, but I can't help feeling
there is more to your question and/or sheet setup than you have told us.


--
Message posted via http://www.officekb.com

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
Change Error Alert Icon in Data Validation [email protected] Excel Programming 3 May 14th 07 06:17 PM
Formula Change Alert C Brandt Excel Discussion (Misc queries) 2 January 25th 07 07:35 PM
How to Create Sound Alert and Email Alert when Macro is Finish Tom Ogilvy Excel Programming 0 November 30th 06 11:12 PM
How to Create Sound Alert and Email Alert when Macro is Finish Bob Phillips Excel Programming 0 November 30th 06 09:21 PM
How to Create Sound Alert and Email Alert when Macro is Finished Bob Davison Excel Programming 0 November 30th 06 08:14 PM


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