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


I have an excel sheet that I designed to look like a form. That form has
default values. Now, what I want to do is that, whenever there is a
change in any cell, let's say for example, someone change the value of
A4, that change will be recorded in C5 for example.

Let's have a working example,

A4 default value = 5

When someone change the value of A4, C5 will show A4. Meaning, A4 has
been changed.

So goes with other cells with default values.

Let's say for example, the value of A5 has been changed, then C5 will
now show "A4, A5" meaning, these cells were changed.

Thank you so much for your assistance!


--
aga2957
------------------------------------------------------------------------
aga2957's Profile: http://www.excelforum.com/member.php...o&userid=25346
View this thread: http://www.excelforum.com/showthread...hreadid=573561

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Detect Cell Changes

What if the user changes the value but then changes it back to the orginal
(default) value ?
Would you still want to log that ?

Tim


"aga2957" wrote in
message ...

I have an excel sheet that I designed to look like a form. That form has
default values. Now, what I want to do is that, whenever there is a
change in any cell, let's say for example, someone change the value of
A4, that change will be recorded in C5 for example.

Let's have a working example,

A4 default value = 5

When someone change the value of A4, C5 will show A4. Meaning, A4 has
been changed.

So goes with other cells with default values.

Let's say for example, the value of A5 has been changed, then C5 will
now show "A4, A5" meaning, these cells were changed.

Thank you so much for your assistance!


--
aga2957
------------------------------------------------------------------------
aga2957's Profile:
http://www.excelforum.com/member.php...o&userid=25346
View this thread: http://www.excelforum.com/showthread...hreadid=573561



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Detect Cell Changes

Starter for 10:

In the Worksheet Class Module (the code behind the worksheet)

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Application.EnableEvents = False
If Range("C5") = "" Then
Range("C5").Value = Target.Address(False, False)
Else
Range("C5").Value = Range("C5").Value _
& ", " & Target.Address(False, False)
End If
Application.EnableEvents = True
End Sub

Regards

Trevor


"aga2957" wrote in
message ...

I have an excel sheet that I designed to look like a form. That form has
default values. Now, what I want to do is that, whenever there is a
change in any cell, let's say for example, someone change the value of
A4, that change will be recorded in C5 for example.

Let's have a working example,

A4 default value = 5

When someone change the value of A4, C5 will show A4. Meaning, A4 has
been changed.

So goes with other cells with default values.

Let's say for example, the value of A5 has been changed, then C5 will
now show "A4, A5" meaning, these cells were changed.

Thank you so much for your assistance!


--
aga2957
------------------------------------------------------------------------
aga2957's Profile:
http://www.excelforum.com/member.php...o&userid=25346
View this thread: http://www.excelforum.com/showthread...hreadid=573561



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Detect Cell Changes


If possible, it shouldn't be log since it was changed to its original
state or value. But if not, it's would be fine.

Thank you so much!


--
aga2957
------------------------------------------------------------------------
aga2957's Profile: http://www.excelforum.com/member.php...o&userid=25346
View this thread: http://www.excelforum.com/showthread...hreadid=573561

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Detect Cell Changes

As long as you are not intending to use these sheets in HTML, you can use
the ID property of the cell like the .Tag property of some controls.
You could set the default value = to this then compare the .Value to the .ID
to see if you need to log the change or not.

With Target
If .Value < .ID Then
'Log it
Else
'clear log for that cell
End If
End With

However, these ID values are not stored with the workbook, so you would have
fill them will when you (re-)open the WB each time.
If this is from a template, you can loop through the cells in question,
setting .ID=.Value.

Otherwise it may be of limited use and it may be better to store the default
values elsewhere, possibly on a hidden sheet.

NickHK

"aga2957" wrote in
message ...

If possible, it shouldn't be log since it was changed to its original
state or value. But if not, it's would be fine.

Thank you so much!


--
aga2957
------------------------------------------------------------------------
aga2957's Profile:

http://www.excelforum.com/member.php...o&userid=25346
View this thread: http://www.excelforum.com/showthread...hreadid=573561



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
Is there a function to detect changes in any given cell? Detecting Cell Value Changes Excel Worksheet Functions 1 January 2nd 05 11:16 PM
detect empty cell mike allen[_2_] Excel Programming 7 July 17th 04 10:55 AM
How to detect if a cell is formula Frank Kabel Excel Programming 0 May 24th 04 07:48 AM
Detect when Active Cell Changes GarethG[_8_] Excel Programming 1 October 22nd 03 02:16 PM
Need to detect cell shading John Wilson Excel Programming 0 September 10th 03 05:43 PM


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