Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Running a macro when there is a given cell entry

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default Running a macro when there is a given cell entry

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Running a macro when there is a given cell entry

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding entry in one cell to a running total in another cell TommyB Excel Worksheet Functions 1 March 11th 09 11:11 PM
Running Macro when a cell value changes Ayo Excel Discussion (Misc queries) 1 April 18th 07 03:09 PM
Macro Run on Cell Entry Michael Excel Dude Excel Discussion (Misc queries) 2 September 1st 06 01:53 PM
Macro to force cell entry before running Chance224 Excel Programming 4 April 25th 05 08:31 PM
Programing a macro to pause while running for data entry Don Guillett[_4_] Excel Programming 0 August 27th 03 12:14 AM


All times are GMT +1. The time now is 05:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"