+ Reply to Thread
Results 1 to 4 of 4

VBA to automatically return a value when codition is met.

  1. #1
    Forum Contributor
    Join Date
    09-01-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, Excel 2013, Excel 2016
    Posts
    115

    VBA to automatically return a value when codition is met.

    Hi All,

    I have the below simple VBA script that works well on it's own

    Please Login or Register  to view this content.
    However what I want to do is to have it execute automatically the value of "000-0000-0000" when F3 is "NO"

    I tried changing the VBA to

    Please Login or Register  to view this content.
    and putting it into the sheet name but it just causes excel to crash and close.

    So clearly I am doing something wrong and need some help fixing it.

    Thanks in advance for any help you can provide.

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: VBA to automatically return a value when codition is met.

    It works fine for me.
    However, I feel that as your code runs each time when any value on the sheet changes, it might be leading to the crash. But I am not sure at all.
    You can try limiting the range to just "F3" as follows-

    Please Login or Register  to view this content.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  3. #3
    Forum Contributor
    Join Date
    09-01-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, Excel 2013, Excel 2016
    Posts
    115

    Re: VBA to automatically return a value when codition is met.

    Thanks such much sourabhg98. Finally it runs without crashing my Excel. Much appreciated for the help and the explanation as well.

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: VBA to automatically return a value when codition is met.

    Glad to know that helped!!
    Thanks for the feedback and reputation!

    Have a Great Day!

+ 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. Vehicle # with Customer id Codition Modify Code
    By hsc14 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-04-2015, 01:57 AM
  2. Replies: 4
    Last Post: 07-24-2015, 12:36 AM
  3. [SOLVED] HLOOK UP next due date based on codition met
    By Iain Clarendon in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-28-2015, 03:16 AM
  4. vba code accordint to the codition the value should display
    By pranav.y in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-27-2013, 05:26 AM
  5. [SOLVED] lookup with more then one codition
    By zia in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-12-2006, 01:35 PM
  6. Choosing a formula to used based on a codition fulfilled
    By The Big Dog in forum Excel General
    Replies: 1
    Last Post: 10-12-2005, 12:05 PM
  7. [SOLVED] get the curser to automatically return
    By Charles in forum Excel General
    Replies: 5
    Last Post: 09-21-2005, 11:05 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