Macro

  • Thread starter Thread starter fernidemex
  • Start date Start date
F

fernidemex

Good morning,
I would appreciate some help with the following: a macro that runs whe
a certain value is reached in a particular cell. How can I programm
such "if" command?
Thank you in advance.
Fernand
 
Hi Fernando

Rightclick the sheet tab, choose "View code", paste this in the module that
shows up:

Private Sub Worksheet_Calculate()
If Me.Range("A1").Value >= 100 Then
Call ActionMacro
End If
End Sub

and either in a standard module or in the same sheet module, paste this:

Sub ActionMacro()
MsgBox "Format C:\ now ?", vbYesNo + vbQuestion
End Sub

(Note: The worksheet in question must contain at least one formula,
otherwise the Calculate event won't start.)

HTH. Best wishes Harald
 

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