+ Reply to Thread
Results 1 to 5 of 5

VBA for arrays and decision

  1. #1
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    VBA for arrays and decision

    Good day. I am venturing out into using arrays. I have searched the net and have been able to make an array work in a spreadsheet. The formula is shown below in the FormulaArray statement.

    Now I need to code in VBA and use variable. The code below is a part of what I have so far. My need is to check for plt in column A and aud_date in Column B. If found in the same row, exit out as the information already exists. If both are not found on the same row, then execute to add the information. I have the code running that allows the entry of the information but have not included here. The MsgBox statements are just for my own checking and will be removed when I have the code working.

    I assigned a variable is_done so that if the 2 pieces of information exist on the same row, you get true and exit, otherwise execute the entry code. Maybe I do not even need to do so. Thoughts?

    Is If...Then...Else the best method?


    Please Login or Register  to view this content.

    Thanks in advance.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: VBA for arrays and decision

    perhaps
    Please Login or Register  to view this content.
    worksheet formulas don't recognize VBA variable so you ahve to build the fomula string using those variables, but not as part of the result.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: VBA for arrays and decision

    Ok. Thanks. So do I put this in an If...Then...Else? Do I need to do something for a TRUE and FALSE situation?

  4. #4
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: VBA for arrays and decision

    I have tried the following code. It executes even when the main file has a match for plt and aud_date on the same row. The intent is if an exact match is found, exit out. Thoughts?

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    09-04-2013
    Location
    Saskatoon, Canada
    MS-Off Ver
    Excel 2010
    Posts
    22

    Exclamation Re: VBA for arrays and decision

    One last request...please.

+ 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. Decision Tree
    By Slosher in forum Excel General
    Replies: 2
    Last Post: 08-29-2014, 09:58 AM
  2. [SOLVED] IF decision with #N/A result
    By plumberef in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-26-2013, 07:37 AM
  3. Decision Tree Add-In?
    By Lon in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-09-2012, 02:58 PM
  4. Decision formula
    By brammo in forum Excel General
    Replies: 8
    Last Post: 03-01-2010, 06:57 AM
  5. Excel decision
    By Reggie2004 in forum Excel General
    Replies: 3
    Last Post: 06-24-2005, 09:29 AM

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