+ Reply to Thread
Results 1 to 2 of 2

Need help with IF statement

  1. #1
    Registered User
    Join Date
    09-06-2011
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    4

    Need help with IF statement

    Hi there, I am a bit weak in Excel VBA, can someone help please.

    I want an IF statement, please tell me what I am doing wrong?

    Example:

    If Range("A1:A20").value = "25" then
    Range ("B1:B20").value = "ABCD"
    Else
    Range ("B1:B20").value = ""
    End If


    Basically what I am trying to say here is if the value 25 is in any of the cells from A1 to A20 then place ABCD text in cell against it in B row or else leave blank.

    Thanks

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    2007
    Posts
    3,427

    Re: Need help with IF statement

    Hi kbp,

    Try this:

    Please Login or Register  to view this content.
    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

+ 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