ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to start a Macro (https://www.excelbanter.com/excel-discussion-misc-queries/123911-how-start-macro.html)

Rick_T

How to start a Macro
 
I have a macro that adds a graphic image to a cell. I want the condition of
another cell to be the trigger to run the macro. If the trigger cell goes
high (is not blank) I want the macro to run one time. Can I do this with an
if statment? if not please suggest.
--
Rick

Sean Timmons

How to start a Macro
 
Go to Tools-Macro-Macros
select your macro, and click Edit.

Where it says
Sub Macro() Replace with:

Private Sub Worksheet_Change(ByVal TargetCell As Range)

Then, skip past the comments (the rows starting with ')

and enter:
If (Range("A1") = 10) Then

Leave your steps that insert the picture here

then enter:
End If

This assumes that A1 is your determining cell, and that a value of 10 or
greater is large enough to trigger the macro.

"Rick_T" wrote:

I have a macro that adds a graphic image to a cell. I want the condition of
another cell to be the trigger to run the macro. If the trigger cell goes
high (is not blank) I want the macro to run one time. Can I do this with an
if statment? if not please suggest.
--
Rick



All times are GMT +1. The time now is 11:50 PM.

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