i have written this code in order to track cell changes in column 5 and enter current time stamp of cell changed in to a cell in column 4.what i want to achieve is that time stamp should only changed if i change value of a cell in column 5 only.but here in this code even if i click on a cell in column 5 it adds current time stamp in to column 4.please help on this.
thanks.
Private Sub Worksheet_Change(ByVal Target As Range) SelectionChange( If Target.Count > 1 Then Exit Sub If Target.Column <> 5 Then Exit Sub Target.Offset(0, -1) = Now End Sub
Last edited by pubudu; 06-28-2011 at 05:52 AM.
Please edit your post to include code tags as per the forum rules
Dom3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Select your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button).
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
You seem to contradict yourself in your explanation. The code you have posted (other than the random 'SelectionChange(' bit which should be removed will put a date/time stamp in the adjacent cell in column 4 if a change is made in column 5.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
See your duplicate post for a workaround.
http://www.excelforum.com/excel-prog...e-changed.html
Regards
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks