Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Previous data in a comment

I use the codes below to track versions (put the previous data in a
comment). But it only works for direct entry (directly typing data into
a cell). Is it possible to do the same thing for formula-generated
entry?

Thanks in advance



Option Explicit

Public acVal

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

Dim ThisChange

ThisChange = Now()
On Error Resume Next
Target.AddComment
Target.Comment.Text "Before you make this change on " &
ThisChange & ", the value was " & acVal
Target.Comment.Shape.TextFrame.Characters(67).Font .Color =
RGB(255, 0, 0)
Target.Comment.Shape.TextFrame.Characters(1).Font. Size = 10

End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If ActiveCell.Address < Target.Address Then Exit Sub
If Target.Value = "" Then
acVal = ""
Else
acVal = Target.Value
End If
End Sub

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
Want previous years data to drop off as I enter current year data rrupp Charts and Charting in Excel 3 February 3rd 10 04:05 PM
3-Color Scale Vlookup for Current Month/Previous/Pre-Previous NeoFax Excel Discussion (Misc queries) 2 January 8th 10 07:04 PM
copy comment content to cell content as data not as comment Lilach Excel Discussion (Misc queries) 2 June 21st 07 12:28 PM
Copy old Data from web query while keeping previous days data DRobidoux Excel Worksheet Functions 0 March 22nd 06 01:56 PM
updating of data without overwriting the previous data updated teyhuiyi Excel Programming 0 April 7th 04 03:40 AM


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