Flag column if changed

I am interested in simply flagging the column using VBA  if anything (in that column alone) has changed.
BirdWatchersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

[ fanpages ]IT Services ConsultantCommented:
How or where would the flagging be recorded?

Internally within Visual Basic for Applications code for later interrogation, visually in-cell somewhere within the same column, or elsewhere (such as a different worksheet, or in an external file, for example)?
0
BirdWatchersAuthor Commented:
I am just going to put a 1 in row 16 of that column  I have an if statement that will trigger logic if the column has changed, but I don't know how to flag if the column has changed.
0
Martin LissOlder than dirtCommented:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(ActiveCell, Range("C1:C100000")) Is Nothing Then
    Columns(3).Select ' or do something else
    End If
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

BirdWatchersAuthor Commented:
There could be anywhere from 50 to 4,000 rows of data  - I just need to now if just one piece has changed in the one column .. that is it.
0
Martin LissOlder than dirtCommented:
Mine works on column C but that's easily changed.
0
[ fanpages ]IT Services ConsultantCommented:
Something like this may be what you are looking for...

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

  Dim objCell                                           As Range
  
  On Error Resume Next
  
  Application.ScreenUpdating = False
  Application.EnableEvents = False
  
  For Each objCell In Target
  
      DoEvents
      
      If objCell.Row <> 16& Then
         Me.Cells(16&, objCell.Column).Value = 1
      End If ' If objCell.Row <> 16& Then
      
  Next objCell ' For Each objCell In Target
  
  Application.EnableEvents = True
  Application.ScreenUpdating = True

End Sub

Open in new window


Please see the attached workbook.

PS. It could be improved by only processing one cell from each column in the Target range, but typically the Worksheet_Change(...) event will only ever process one cell at a time anyway, so that approach may well be just for very extreme cases.

The code above copes with changing multiple cells at once, though.
Q-28702863.xlsm
0
Martin LissOlder than dirtCommented:
Simply this where 3 represents column C..

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns(3)) Is Nothing Then
    Cells(16, 3) = 1
    End If
End Sub

Open in new window

0
Martin LissOlder than dirtCommented:
I'm glad I was able to help. If you actually chose one of my solutions that used 'ActiveCell', you should substitute 'Target'.

In my profile you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2015, Experts-Exchange Top Expert Visual Basic Classic 2012 to 2014
0
[ fanpages ]IT Services ConsultantCommented:
You're welcome, BirdWatchers.

(Sigh)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.