+ Reply to Thread
Results 1 to 2 of 2

Multi Conditional If Macro

  1. #1
    Registered User
    Join Date
    07-27-2015
    Location
    UK
    MS-Off Ver
    2010
    Posts
    1

    Multi Conditional If Macro

    Hi,

    I require some help with a problem I am having in excel. I require a macro that will read an adjacent cell and return a specific value...i.e if b3 = "xyz" then c3=a3. This would seem simple enough and can be easily done through a simple IF function without the need for Macros, however things become more complex.

    - If b3 = xyz, then all the remaining cells within the range (for example b3 to b10) shoud remain blank
    - In the event that b3 <> xyz then the macro must consider the next best option
    - The next best option would be defined as if b3 = "abc" then c3=a3, with again the remaining cells within the range that the macro covers remaining blank

    Essentially i would like the module to look through the range until one of the options occurs.

    Excuse my novice attempt at vba code but I was thinking it would look something like:

    If B3 = "xyz" Then
    C3 = A3
    C4 = ""
    C5 = ""
    C6 = ""
    C7 = ""
    C8 = ""
    End If

    If B3 = "abc" Then
    C3 = A3
    C4 = ""
    C5 = ""
    C6 = ""
    C7 = ""
    C8 = ""
    End If

    Can anyone please advise on how to move forward with this and any other suggestions?

    Thanks.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Multi Conditional If Macro

    your requirement is not clearly explained.

    from the data you have given

    Please Login or Register  to view this content.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Multi-Conditional Conditional Formatting and Dates
    By Mousiefuzz in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-07-2015, 04:09 AM
  2. Multi-Macro and Multi-Listbox help
    By VBAnooob in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2012, 02:55 AM
  3. Excel 2007 : Multi Conditional Sum
    By jesz1987 in forum Excel General
    Replies: 7
    Last Post: 10-19-2010, 06:38 AM
  4. Excel 2007 : Multi Conditional Sum
    By jesz1987 in forum Excel General
    Replies: 1
    Last Post: 10-14-2010, 06:51 AM
  5. Multi Conditional Sum
    By Brianboy_24 in forum Excel General
    Replies: 1
    Last Post: 09-08-2010, 05:40 PM
  6. multi conditional searching
    By realspido in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-27-2006, 04:55 AM
  7. Multi-Conditional IF Statements
    By stacy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2006, 09:49 PM

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