PC Review


Reply
Thread Tools Rate Thread

compare oldvalue and new value of a cell

 
 
shiro
Guest
Posts: n/a
 
      25th Jul 2008
Hi All,
how to write a code to compare the value of a cell
before it's being updated by user.If the new value
is different with the new value,I want the cell
background colour become different.But since
I have many sheet in my workbook,I want the code
become public and I try to keep the sheet clean
from any vba code.
Thank's

Shiro


 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      25th Jul 2008
Hi,


This may help. Right click your sheet tab, view code and paste this in

Private Sub Worksheet_Change(ByVal Target As Range)
If TargetVal <> Target Then
Target.Interior.ColorIndex = 3
TargetVal = vbNullString
End If

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
TargetVal = Target
End Sub

Mike


"shiro" wrote:

> Hi All,
> how to write a code to compare the value of a cell
> before it's being updated by user.If the new value
> is different with the new value,I want the cell
> background colour become different.But since
> I have many sheet in my workbook,I want the code
> become public and I try to keep the sheet clean
> from any vba code.
> Thank's
>
> Shiro
>
>
>

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare OldValue and value Stu Microsoft Access Form Coding 5 18th Feb 2009 08:19 PM
Replace only full words that matches oldValue and not when oldValue is a substring of a larger word Avi Microsoft C# .NET 8 16th Jun 2008 12:03 PM
Compare OldValue of TextBox in GridView David C Microsoft ASP .NET 1 21st Dec 2007 04:58 AM
Compare text string of a cell in Column A VS another cell in Colum =?Utf-8?B?VGFu?= Microsoft Excel Worksheet Functions 1 1st Aug 2007 09:01 AM
How do I compare cells and if FALSE compare to next cell in EXCEL =?Utf-8?B?Q2luZGll?= Microsoft Excel Worksheet Functions 0 24th Mar 2006 05:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:38 PM.