excel Function/macro

  • Thread starter Thread starter Lance Masunaga
  • Start date Start date
L

Lance Masunaga

Is it possible to run a macro and a function
simultaneousely. Example. When you run a macro if a
certain cell has a specific data in it then do this, if
not then do something else? Is this even possible???
Thanks.
 
Lance,

of course. Have fun!

Sub doSomethingBasedOnCellValue()

i = Range("A1").Value
If i < 2 Then
MsgBox "It is less then 2", vbOKOnly, "I checked the
value of cell A1"
Else: MsgBox "It is " & i, vbOKOnly, "I checked the value
of cell A1"
End If

End Sub
 
Back
Top