ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Run macro based on range value (https://www.excelbanter.com/excel-discussion-misc-queries/172527-run-macro-based-range-value.html)

saman110 via OfficeKB.com

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

thx.

--
Message posted via http://www.officekb.com


Jim Thomlinson

Run macro based on range value
 
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
--
HTH...

Jim Thomlinson


"saman110 via OfficeKB.com" wrote:

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

thx.

--
Message posted via http://www.officekb.com




All times are GMT +1. The time now is 02:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com