Solved

Flag Rows that were Changed

Posted on 2013-01-29
5
284 Views
Last Modified: 2013-01-29
Hello All,

I am in a issue. There is sheet with three possible columsn – where user can enter the data and changes the existing value. How do I flag the rows using worksheet change event of any other VBA ways  - that will tell me that a particular row has been changed if any of the three column (C1,C2,C3) values have changed for a row.

For example: if C1 column value of row 7 has changed, and  if C3 value of row 10 has changed, then those two rows are flagged as “changed” somehow and a new column or something stores that info.

I am doing this so that I can auto filter by that “CHANGED ” COLUMN

C1      C2      C3      dsads
eq            ew      
wq      e      ew      
qwe      wqe      wqe      
qwe      wqe            
qwe      we            
qwe      we
sheetCahnge.xlsx
0
Comment
Question by:Rayne
  • 3
  • 2
5 Comments
 

Author Comment

by:Rayne
ID: 38831105
worksheet change event or anything really - how can I do it?
0
 
LVL 26

Accepted Solution

by:
redmondb earned 500 total points
ID: 38831181
Hi, Rayne.

Please see attached. The code is...
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim xRange As Range
Dim xCell As Range

Set xRange = Intersect(Me.Range("D6:F12"), Target)

If xRange Is Nothing Then Exit Sub

Application.EnableEvents = False

    For Each xCell In xRange
        xCell.Font.Color = -16776961
        Me.Cells(xCell.Row, 7) = True
    Next

Application.EnableEvents = True

End Sub

Open in new window

Regards,
Brian.sheetCahnge-V2.xlsm
0
 

Author Comment

by:Rayne
ID: 38831913
Perfect Brian, this works like Gold
0
 
LVL 26

Expert Comment

by:redmondb
ID: 38832098
Thanks, Rayne.
0
 

Author Comment

by:Rayne
ID: 38833070
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ifna and iferror 1 32
First Blank Cell in a range 7 34
time format showing wrong 12 50
Excel VBA - merge "specific" data from workbook in to "new" workbook. 19 21
My experience with Windows 10 over a one year period and suggestions for smooth operation
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now