Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to get my sheet to automatically run a macro, when a user
inputs the character "Y". It's reasonably straightforward to tie a macro in with a button press but I am not sure if it's as easy to do with a specific cell entry. I'm sure there should be a way to do this. Ideas? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Pretty simple with an event macro ... Private Sub Worksheet_Change(ByVal Target As Range) If Target.Value = "Y" Then Application.Run ("yourmacro") End If End Sub HTH Carim |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If Target.Value = "Y" Then
Application.Run ("yourmacro") End If I don't think there is any reason to use Application.Run. You can just use the macro's name: If UCase(Target.Cells(1).Value) = "Y" Then yourmacro Cells(1) just in case the user does a Ctrl-Enter with multiple cells selected. The UCase for case insensitivity. -- Jim "Carim" wrote in message oups.com... | Hi, | | Pretty simple with an event macro ... | | Private Sub Worksheet_Change(ByVal Target As Range) | If Target.Value = "Y" Then | Application.Run ("yourmacro") | End If | End Sub | | HTH | Carim | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Adding entry in one cell to a running total in another cell | Excel Worksheet Functions | |||
Running Macro when a cell value changes | Excel Discussion (Misc queries) | |||
Macro Run on Cell Entry | Excel Discussion (Misc queries) | |||
Macro to force cell entry before running | Excel Programming | |||
Programing a macro to pause while running for data entry | Excel Programming |