Hi,
Need a VBA code or any other way to highlight the cell wherever someone edit the cells (data pasted from other source should be ignored and should not be highlighted).
An excel file attached with necessary details.
Kindly help.
Nagesh.
Hi,
Need a VBA code or any other way to highlight the cell wherever someone edit the cells (data pasted from other source should be ignored and should not be highlighted).
An excel file attached with necessary details.
Kindly help.
Nagesh.
If we assume that copying/pasting from elsewhere will be done for multiple cells, then that does not count as a change.
(If only copying/pasting one cell, it is considered a change.)
This code is placed in the worksheet module, triggering any changes in the cell and highlighting them.
PHP Code:
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("E:F")) Is Nothing Then Exit Sub
If Target.CountLarge > 1 Then Exit Sub
Target.Interior.Color = vbYellow
End Sub
Quang PT
Why would you assume that?
The function below will check to see if the last action was a 'paste'.
It will return true if the change was made with a paste and false if it was changed in any other manner.
So put this line in your change event to ignore the change if it was pasted.
The function;Please Login or Register to view this content.
Please Login or Register to view this content.
Hi Bebo,
As per initial trials, its working perfectly and as per requirement.
For now, marking the thread as solved.
Will get back to you if i find any issue during the usage.
Thank you so much.
@Eeza
Thank you so much to you too for your code.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks