Need code for simple change event

  • Thread starter Thread starter Jake
  • Start date Start date
J

Jake

I want to run a simple If..Then based on a change to a range of cells
containing text. Basically something like this

If Range("E50:E100") changes Then
Range("A3") = Now()
End if

So if the text changes in the range the date of the document updates
to the system date. Seems like it should be simple but I can't figure
out how to do it. Any help appreciated.

Jake
 
Hi Jake,

Here's one way to do it:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngTest As Range
On Error Resume Next
Set rngTest = Intersect(Target, Me.Range("E50:E100"))
On Error GoTo 0
If Not rngTest Is Nothing Then
Me.Range("A3").Value = Now()
End If
End Sub

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top