+ Reply to Thread
Results 1 to 4 of 4

Two conditions in IF statement

  1. #1

    Two conditions in IF statement

    Hello,

    I am trying to write a macro which uses If statements subject to two
    logic checks.

    Example

    Sub test()
    IF(A3>=B3 & A3<=C3) Then
    Range("B7").Select
    Selection.Copy
    ....
    End IF
    End Sub

    Any help on this is much appreciated. Thanks


  2. #2
    JE McGimpsey
    Guest

    Re: Two conditions in IF statement

    One way:

    Public Sub Test()
    If Range("A3").Value >= Range("B3").Value And _
    Range("A3").Value <= Range("C3").Value Then
    Range("B7").Copy
    '...
    End If
    End Sub



    In article <[email protected]>,
    [email protected] wrote:

    > Hello,
    >
    > I am trying to write a macro which uses If statements subject to two
    > logic checks.
    >
    > Example
    >
    > Sub test()
    > IF(A3>=B3 & A3<=C3) Then
    > Range("B7").Select
    > Selection.Copy
    > ...
    > End IF
    > End Sub
    >
    > Any help on this is much appreciated. Thanks


  3. #3
    Doug
    Guest

    Re: Two conditions in IF statement

    Hi

    Sub aaa()
    If Range("A3").Value >= Range("B3").Value And Range("A3").Value <=
    Range("C3").Value Then
    Range("B7").Copy
    End If
    End Sub


    Doug

    [email protected] wrote in message
    <[email protected]>...
    >Hello,
    >
    >I am trying to write a macro which uses If statements subject to two
    >logic checks.
    >
    >Example
    >
    >Sub test()
    >IF(A3>=B3 & A3<=C3) Then
    >Range("B7").Select
    >Selection.Copy
    >...
    >End IF
    >End Sub
    >
    >Any help on this is much appreciated. Thanks
    >




  4. #4

    Re: Two conditions in IF statement

    Guys,

    you guys saved my butt. thanks for all your help.

    Tushar


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1