Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Flag Rows that were Changed

Posted on 2013-01-29
5
Medium Priority
?
324 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 2000 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

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Ever wonder what it's like to get hit by ransomware? "Tom" gives you all the dirty details first-hand – and conveys the hard lessons his company learned in the aftermath.
Windows Explorer let you handle zip folders nearly as any other folder: Copy, move, change, and delete, etc. In VBA you can also handle normal files and folders, but zip folders takes a little more - and that you'll find here.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

876 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