Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
APS APS is offline
external usenet poster
 
Posts: 5
Default Getting pre edit values

I am using Worksheet_Change to identify edits on a sheet and highlight the
changes where appropriate by testing on the Target object.

What I really need is to be able to retrieve the value of the cell before
the edit is done, i.e. if the cell is changed from 2 to 3 I need to retieve
the value 2.

Is this possible??

Tnanks in advance for any help on this.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Getting pre edit values

In the change event,
store the current value of the changed cell
Disable Events
Application.Undo
store the value of the changed cell (this is the 2 in your example)
write the first value you stored
enable events

--
Regards,
Tom Ogilvy

"aps" wrote in message
...
I am using Worksheet_Change to identify edits on a sheet and highlight the
changes where appropriate by testing on the Target object.

What I really need is to be able to retrieve the value of the cell before
the edit is done, i.e. if the cell is changed from 2 to 3 I need to

retieve
the value 2.

Is this possible??

Tnanks in advance for any help on this.



  #3   Report Post  
Posted to microsoft.public.excel.programming
APS APS is offline
external usenet poster
 
Posts: 5
Default Getting pre edit values

Thanks Tom, neet solution works wonderfully. Would be good if 'pre edit
value' was an attribute on the Target object though. Next release maybe.

"Tom Ogilvy" wrote:

In the change event,
store the current value of the changed cell
Disable Events
Application.Undo
store the value of the changed cell (this is the 2 in your example)
write the first value you stored
enable events

--
Regards,
Tom Ogilvy

"aps" wrote in message
...
I am using Worksheet_Change to identify edits on a sheet and highlight the
changes where appropriate by testing on the Target object.

What I really need is to be able to retrieve the value of the cell before
the edit is done, i.e. if the cell is changed from 2 to 3 I need to

retieve
the value 2.

Is this possible??

Tnanks in advance for any help on this.




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
Excel 2003/edit/replace. Under Options/Look In, values is AWOL bu. cp Excel Discussion (Misc queries) 2 March 15th 13 12:07 PM
Why can't I edit my excel document? Edit buttons shaded. Arl @ CBC New Users to Excel 3 September 7th 05 01:18 AM
edit x-values in XY Scatter? JethroUK© Charts and Charting in Excel 5 January 28th 05 11:41 PM
Edit/Find/Options/Look In/Values Hi Ho Silver Excel Worksheet Functions 1 January 13th 05 03:20 AM
Predict Y-values on new X-values based on other actual X and Y values? NorTor Excel Programming 2 August 10th 03 03:08 PM


All times are GMT +1. The time now is 12:21 AM.

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"