VBA - If two different ranges contain values
Results 1 to 2 of 2

Thread: VBA - If two different ranges contain values
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Oct 2011
    Posts
    337
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default VBA - If two different ranges contain values

    Hi there

    I need some help! I need to know how to code if two different ranges contain different values then to execute my code...

    I have...

    Code:
    If Range("A1").Value = "xxx" Then
    What I need Is the above, but also if A3 does NOT contain a value to execute the code, if A1 contains "XXX" and A3 contains ANY value then to carry out my code, if not nothing...

  2. #2
    MrExcel MVP Jonmo1's Avatar
    Join Date
    Oct 2006
    Location
    Bryan, TX
    Posts
    44,054
    Post Thanks / Like
    Mentioned
    19 Post(s)
    Tagged
    0 Thread(s)

    Default Re: VBA - If two different ranges contain values

    Try

    If Range("A1").Value = "xxx" And Range("A3").Value <> "" Then
    Last edited by Jonmo1; Jun 11th, 2018 at 09:54 AM.
    Use the MrExcel HTML Maker to post nicely formatted tables in your forum posts.
    Find a link in post number 31

    The more we learn, and the better we get at our trade, the easier it becomes to overlook the obvious.

    Life moves pretty fast. If you don't stop and look around once in a while, you could miss it.
    Ferris Bueller A.K.A. John Hughes, 1986

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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