0

I have setup a control worksheet. In Column J I have a drop down list - If "Y" is select then it triggers a UDF in column I to apply a signature (sign off). I'm looking for a trigger to hard code to the whole row after the UDF runs. So if "Y" in selected in any cell in column J then hard code protect/lock that entire row.

Looking for tips on how to handle/go about setting up the trigger - I think I should be able to setup the locking/protecting. Plus I presume a time delay will allow the UDF to run before locking the row?

All advice welcome,

Thank you,

Ciaran

Community
  • 1
  • 1
user1624926
  • 441
  • 2
  • 6
  • 16
  • You may want to see [THIS](http://stackoverflow.com/questions/13860894/ms-excel-crashes-when-vba-code-runs/13861640#13861640) since you would be working with ` Worksheet_Change()` Also see @DougGlancy's comment below my answer. – Siddharth Rout Sep 08 '14 at 21:04

1 Answers1

1

Create a worksheet change event. Any time a change in column J is detected, the code will run.

Private Sub Worksheet_Change(ByVal Target As Range)
   If Target.Column = 10 Then
      'insert your code here
   End If
End Sub

Use Target.Address for the exact cell reference. You could even incorporate your UDF code in here instead of running a separate process.

Tony
  • 2,658
  • 2
  • 31
  • 46