Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default run macro only if condition is met

I need to run a macro (copy one cell into another) only if a certain
condition is met. For example, if x=a, then run this macro. If not, do
something else.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default run macro only if condition is met

Sub Macro1()
If Cells(1, 1) = 1 Then
Exit Sub
Else
MsgBox ("HI")
End If
End Sub

--
Gary's Student


"Nikonov" wrote:

I need to run a macro (copy one cell into another) only if a certain
condition is met. For example, if x=a, then run this macro. If not, do
something else.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default run macro only if condition is met

Didn't you answer it

if x="a" then
run thismacro
else
do something else
end if

--
Don Guillett
SalesAid Software

"Nikonov" wrote in message
...
I need to run a macro (copy one cell into another) only if a certain
condition is met. For example, if x=a, then run this macro. If not, do
something else.



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
Delete Macro with OR/ELSE condition Mike Excel Discussion (Misc queries) 5 January 11th 10 09:08 PM
Macro if condition puiuluipui Excel Discussion (Misc queries) 5 November 13th 09 12:07 PM
use more than 4 condition in cf without using macro Montu Excel Worksheet Functions 3 November 15th 07 03:19 PM
event macro on a condition TUNGANA KURMA RAJU Excel Discussion (Misc queries) 2 December 19th 05 07:15 AM
macro to run only under certain condition - how? Orion[_2_] Excel Programming 2 December 22nd 04 10:08 AM


All times are GMT +1. The time now is 03:13 AM.

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

About Us

"It's about Microsoft Excel"