+ Reply to Thread
Results 1 to 7 of 7

Formula spoiling the code?

  1. #1
    Registered User
    Join Date
    02-13-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    70

    Talking Formula spoiling the code?

    Hi i am not sure if putting a formula in the cell is causing the below code preventing it from running, before anymore details please take a look at the code below which is working perfectly fine after the code i will explain what it does...

    Please Login or Register  to view this content.
    ok basically this code makes sure that whenever there is a change in A column for range of A1 to A27 it will take a mean value from D column and then the max value will be placed inside the respective B column and minimum value will be placed in C.
    Run the code for your self to get a better understanding if you are a forex trader you will understand it faster that's the only benefit.
    For those pro's and administrators who understand this code well, here is my question.
    There is a change happening whenever there is a change of value in A and the code runs perfectly fine. Problem is when i apply this formula in A 1 lets say A1's formula is =F1.
    So by logic when ever there is a change in F1 there will be a change in A1 too which is good, but according to the code there should be a change occurring in B and C as well but there is no change its like the code is never being initiated

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Formula spoiling the code?

    That right
    it is trigger by user change not formula change
    Last edited by pike; 05-16-2010 at 06:37 AM.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Formula spoiling the code?

    If F1 changes, the worksheet_change event will be triggered.
    The target is beyond the range you want te code to be executed. (column A or columnD); so the code won,'t be executed if F1 has been changed.
    The change in A1 because of the formula won't trigger the Worksheet_Change event.
    So by changing F1 the target in the eventprocedure will never meet the specified criteria for running the code.

  4. #4
    Registered User
    Join Date
    02-13-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Formula spoiling the code?

    so i there another code that i can overcome this problem and yet achieve the same result? tks

  5. #5
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Formula spoiling the code?

    how do you enter values in F1

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula spoiling the code?

    FWIW - this thread has since been duplicated (and responded to)

    http://www.excelforum.com/excel-prog...a-formula.html

    jackandjill, do not duplicate threads - this simply increases the risk of people wasting their freely donated time.

  7. #7
    Registered User
    Join Date
    02-13-2010
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Formula spoiling the code?

    oh no as you can see that this was merely to confirm that what i presumed to be right... so in the other thread i will be posting more code than just answers in order to find a solution to this.
    If it appeared to be such that to duplicate thread then pardon me..

+ 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