Run macro based on range value

  • Thread starter Thread starter saman110 via OfficeKB.com
  • Start date Start date
S

saman110 via OfficeKB.com

How can I create a macro that whenever I type "y" or "Y" in "O" column, it
run a macro.

thx.
 
This code is worksheet event code so it must be posted into the sheet. Right
click the approporate tab and select View Code. Paste the following...

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 15 And UCase(Target.Value) = "Y" Then
MsgBox "Run your macro"
End If
End Sub
 

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