Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default compare oldvalue and new value of a cell

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default compare oldvalue and new value of a cell

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
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
Compare text string of a cell in Column A VS another cell in Colum Tan Excel Worksheet Functions 1 August 1st 07 09:01 AM
Compare text string of a cell in Column A VS another cell in Colum Tan Excel Programming 0 July 30th 07 05:12 PM
Listbox OldValue Jonathan Excel Programming 1 July 10th 06 02:25 AM
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM
OldValue property Lulu Excel Programming 3 April 19th 05 07:44 PM


All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"