+ Reply to Thread
Results 1 to 13 of 13

Change the value of cells if other cell CHANGES

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Change the value of cells if other cell CHANGES

    I need to do a VBA script that changes the value of AO5:AR5 to "" if the value of A5 changes

    Thanks

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change the value of cells if other cell CHANGES

    How about

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change the value of cells if other cell CHANGES

    Why it just works if I put in the begin of the Change sub?

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change the value of cells if other cell CHANGES

    I'm sorry but I don't quite understand.

    How did you use the code in post #2?

    Did you put it behind the sheet or what did you do?

  5. #5
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change the value of cells if other cell CHANGES

    Nevermind, I had a Exit Sub before Thanks for the help!

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change the value of cells if other cell CHANGES

    Glad to hear you have it working. You're welcome and thanks for the feedback

  7. #7
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change the value of cells if other cell CHANGES

    I'm with one problem.. The thing is the A5 values change according to a connected program. That way it only clear values if I change it "manually".. Is it possible to put to change if it changes because of "non-direct" input?

  8. #8
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change the value of cells if other cell CHANGES

    How is the value coming in to A5? What is the program it is connected to and does that program just force the number in there?

    Maybe you can use a Worksheet calculate event.

  9. #9
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change the value of cells if other cell CHANGES

    The program is Betassistant. I dont know exactly how it works, but I think it forces the value to be changed. How can I use that? I'm really newbie in this excel things :S

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change the value of cells if other cell CHANGES

    Well since I don't have the program in front of me to test, I would try something like worksheet calculate

    Example:
    Please Login or Register  to view this content.
    This is just a guess...

    If that does not work, then maybe something like linking a cell to A5

    Example >> in some empty cell type in =A5

    When the program enters a value in A5 then the cell setup with =A5 will update thereby producing a calculation.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change the value of cells if other cell CHANGES

    Non of the codes worked for what I wanted. I tried to use your idea of redirecting the Value to other cell but it still not working... If I change it manually it does work, but with the information provided by the other program it doesn't If I put it on Calculate it crashes, so I put on Change.. any other possible solutions?

  12. #12
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Change the value of cells if other cell CHANGES

    Is the program pulling the information in via Dynamic Data Exchange (DDE)? I spoke with one of our forum guru's and he said, if this is the case, take a look in Excel help about Worksheet.SetLinkOnData.

  13. #13
    Registered User
    Join Date
    06-22-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Change the value of cells if other cell CHANGES

    How do I know how the program gives the information to excel? In the program I just need to select the excel book I want and it does all the rest for 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