Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recording Cell Changes 1

Status
Not open for further replies.

campbemr

Technical User
Aug 16, 2001
19
US
I am trying to create a macro that will record the changes that are being made to any cells within columns c,d,and e. From looking at previous posts I see that the worksheet_change event will be used to recognize the change in the sheet. But I have not been able to find any posts that help in being able to transfer the cell number, previous value, and the value that it has been changed to. I want to just start listing these changes on another worksheet. How can this be done?
 
Dunno about previous value but for the rest try summat like this:

worksheet_change event

select case target.column
case is "C","D","E"
tStr = target.text
tAdd = target.address
tDate = format(now(),"dd/mm/yy hh:mm")
with sheets("Changes")
lRow = .range("A65536").end(xlup).row
.range("A" & lRow+1).formula = tAdd
.range("B" & lRow+1).formula = tStr
.range("C" & lRow+1).formula = tDate
end with
case else
end select
end sub

HTH Rgds
~Geoff~
 
Thanks for the help. The code worked great.
I had to change the line
case is "C","D","E" to
case 3 to 5
to get it to work. I don't know why. I'm just throwing that out there for anyone who tries to use this in the future and has problems.
Thanks

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top