Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Using IF to decide action

I have two options to act in ActiveCell depending on value of cell in the
third column to the left of active cell i.e. Offset(0,-3). I have two
separate macros say Macro1 and Macro2 to call depending on if the value is
=1 or <1. I don't know the IF process. Please help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Using IF to decide action

Try this

If ActiveCell.Offset(, 3).Value = 1 Then
'Macro1
ElseIf ActiveCell.Offset(, 3).Value < 1 Then
'macro2
End If

Mike

"a m spock" wrote:

I have two options to act in ActiveCell depending on value of cell in the
third column to the left of active cell i.e. Offset(0,-3). I have two
separate macros say Macro1 and Macro2 to call depending on if the value is
=1 or <1. I don't know the IF process. Please help.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Using IF to decide action

many thanks mike. this is what i needed. will try it out and get back if
there are any issues.

"Mike H" wrote:

Try this

If ActiveCell.Offset(, 3).Value = 1 Then
'Macro1
ElseIf ActiveCell.Offset(, 3).Value < 1 Then
'macro2
End If

Mike

"a m spock" wrote:

I have two options to act in ActiveCell depending on value of cell in the
third column to the left of active cell i.e. Offset(0,-3). I have two
separate macros say Macro1 and Macro2 to call depending on if the value is
=1 or <1. I don't know the IF process. Please help.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Using IF to decide action

This is what has worked.

If ActiveCell.Offset(0, -3).Value = 1 Then
Call Sale
ElseIf ActiveCell.Offset(0, -3).Value < 1 Then
Call Sale2
End If

many thanks once again.

"Mike H" wrote:

Try this

If ActiveCell.Offset(, 3).Value = 1 Then
'Macro1
ElseIf ActiveCell.Offset(, 3).Value < 1 Then
'macro2
End If

Mike

"a m spock" wrote:

I have two options to act in ActiveCell depending on value of cell in the
third column to the left of active cell i.e. Offset(0,-3). I have two
separate macros say Macro1 and Macro2 to call depending on if the value is
=1 or <1. I don't know the IF process. Please help.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Using IF to decide action

Glad I could help. I missed the negative 0ffset(,-3)

Mike

"a m spock" wrote:

This is what has worked.

If ActiveCell.Offset(0, -3).Value = 1 Then
Call Sale
ElseIf ActiveCell.Offset(0, -3).Value < 1 Then
Call Sale2
End If

many thanks once again.

"Mike H" wrote:

Try this

If ActiveCell.Offset(, 3).Value = 1 Then
'Macro1
ElseIf ActiveCell.Offset(, 3).Value < 1 Then
'macro2
End If

Mike

"a m spock" wrote:

I have two options to act in ActiveCell depending on value of cell in the
third column to the left of active cell i.e. Offset(0,-3). I have two
separate macros say Macro1 and Macro2 to call depending on if the value is
=1 or <1. I don't know the IF process. Please help.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Using IF to decide action

dear mike,
in a parallel situations what would need to be done if i need to skip all
action for offset(0,-3).value =1 and move down in the column until i find a
cell with the corresponding offset(0,-3).value <1 then call macroX

ams

"Mike H" wrote:

Glad I could help. I missed the negative 0ffset(,-3)

Mike

"a m spock" wrote:

This is what has worked.

If ActiveCell.Offset(0, -3).Value = 1 Then
Call Sale
ElseIf ActiveCell.Offset(0, -3).Value < 1 Then
Call Sale2
End If

many thanks once again.

"Mike H" wrote:

Try this

If ActiveCell.Offset(, 3).Value = 1 Then
'Macro1
ElseIf ActiveCell.Offset(, 3).Value < 1 Then
'macro2
End If

Mike

"a m spock" wrote:

I have two options to act in ActiveCell depending on value of cell in the
third column to the left of active cell i.e. Offset(0,-3). I have two
separate macros say Macro1 and Macro2 to call depending on if the value is
=1 or <1. I don't know the IF process. Please help.

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
Excell copy action pauses for 15 second for the smallest action Meekal Excel Discussion (Misc queries) 1 January 28th 10 04:30 PM
How to decide if an excel file has got VBA code in it ? Sujit Excel Discussion (Misc queries) 1 August 19th 08 12:06 PM
User to decide how often a macro runs Deedee Excel Discussion (Misc queries) 2 November 2nd 05 08:42 PM
Are alien abductions real? You decide - 1 attachment GordonJ Excel Discussion (Misc queries) 0 October 11th 05 11:03 AM


All times are GMT +1. The time now is 12:48 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"