+ Reply to Thread
Results 1 to 33 of 33

Automatically change cell value based on other cell value

  1. #1
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Automatically change cell value based on other cell value

    Hi
    I Need Macro Automatically Past Yes Of Cell J To Cell K
    If Cell J Change to yes

    And When Change Cell J to Yes Past Cell D to cell L

    TEST9.jpg

    http://www.2shared.com/file/pBaU8RK-/book1.html
    Last edited by etheer; 11-11-2012 at 05:53 PM.

  2. #2
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hello etheer,

    Why a Macro, if you could do it with formulas as per the attached WorkBook?

    Also see the "Please consider" note at the bottom of this post.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  3. #3
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Hi Winon
    Thank you
    but i need macro because i want when change cell J again no do not delete yes and number from cell K and L
    plaese help me if you can

  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hi etheer,

    But you do say in your first post;

    And When Change Cell J to Yes Past Cell D to cell L
    Maybe we have a misunderstanding here?

    I have entered the formulas on your spreadsheet, See if it is acceptable now.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Thank you so much for your help Winon
    but if change cell J no delete yes and number from cell K and L
    i need when past yes and number in cell K and L do not delete

    i get this macro

    Please Login or Register  to view this content.
    maybe you can edit it for work
    Last edited by etheer; 11-11-2012 at 08:42 PM.

  6. #6
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    My problems
    1-When cell J change to no delete yes and number from cell K and L
    2- When i change in in cell F,G,H change cell J to yes but do not past yes and number in cell K and L

  7. #7
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    I hope you can help me Winon

  8. #8
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    i get this code but not work 100%

    Please Login or Register  to view this content.

  9. #9
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hi etheer,

    O.K. Let us try this one. It is still using formulas, but retain the values as long as the Cell/s in Column D has some data.
    Attached Files Attached Files

  10. #10
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    If you prefer the alternative code then copy this Code over mine.

    Just remember that with any one of the two solutions you have now, the code will only work in the Row where you change any cell in Column D.

    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    I wait someone help me

  12. #12
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Have you tried the WorkBook in Post no. 9? Or the code in Post no. 10? If you tell us what you don't like about it, then maybe someone help you.

  13. #13
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Hi
    I found code work very good but i need edit it with this sheet
    Please help me

    http://www.2shared.com/file/p4jlW0Rl/Book1.html

  14. #14
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    If you like that Code, then based on the Sample WorkBook in Post Number 9, use it like this:

    Please Login or Register  to view this content.
    Hope that helps.
    Last edited by Winon; 11-13-2012 at 02:25 AM. Reason: Check the correct Sample WorkBook

  15. #15
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Thank you so much winon yes work code very good
    but i edit

    If Not Intersect(Target, Range("H:F")) Is Nothing Then

    TO

    If Not Intersect(Target, Range("M:N:O:P")) Is Nothing Then

    And i used formula in cell J

    =IF(AND(M7>=50%;N7>50%;O7>0%;P7>-30%;F7>0.2;X7<10%;Y7<10%);"Yes";"No")


    good ?

  16. #16
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hello etheer,

    You can change this line:

    If Not Intersect(Target, Range("M:N:O:P")) Is Nothing Then
    to

    If Not Intersect(Target, Range("M:P")) Is Nothing Then
    or to any other Range which you would like the Code to respond to, when you change any Data.

    Your Formula in Column J has no effect on the "Intersect Target Range".
    Last edited by Winon; 11-13-2012 at 01:06 PM. Reason: Sentence structure

  17. #17
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Quote Originally Posted by Winon View Post
    Hello etheer,

    You can change this line:



    to



    or to any other Range which you would like the Code to respond to, when you change any Data.

    Your Formula in Column J has no effect on the "Intersect Target Range".
    Thank you so much winon now work code very good

  18. #18
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Winon i have ask

    I can found code or edit code delete yes and number every new month

    Impossible ?

  19. #19
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    No it is not Impossible,

    What do you want to delete? Make sample and show me.

  20. #20
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    I have problem in code when i change manual in cell H:F
    work code very good but i take data from website if change data in cell H:F not work code

    i want cry please help me

    Please Login or Register  to view this content.

  21. #21
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Please test this sheet when i change in sheet M2 not work code
    Attached Files Attached Files

  22. #22
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hello etheer,

    Use this Code:

    Please Login or Register  to view this content.
    Also see "Please consider" at bottom of this post.

  23. #23
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Thank you winon
    You can edit code no need cell F:H,M:P
    My problem now if used keybored and change in cell work code very good but when i take data online and change cell J to yes do not work code

  24. #24
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Then try it like this:

    Please Login or Register  to view this content.

  25. #25
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hello etheer,

    Did you try the Code as per my last post?

  26. #26
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Thank you winon i test code but also not work
    If used keybored in sheet 1 and click enter work code
    If data change automatic and change J to yes not work code
    I do not want to connect sheet with sheet in code
    I know you're tired trying to help me thank you so much winon
    Attached Files Attached Files

  27. #27
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    i change line

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim c As Range

    TO

    Private Sub Worksheet_Calculate()
    Dim c As Range

    I hope now work good

  28. #28
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    I was thinking about the calculate aspect as well.

    So try this:

    Please Login or Register  to view this content.

  29. #29
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    I edit code to

    Please Login or Register  to view this content.

    work code 100% i have only one problem

    when change any cell to #N/A code work crazy and past yes and number in all cells
    how edit code not work if cells #N/A
    Last edited by etheer; 11-19-2012 at 03:55 PM.

  30. #30
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hi etheer,

    Sorry, but I was away on renovating a house. Please try this formula in Column J with my sample code as per Post No. 28.

    Please Login or Register  to view this content.
    Last edited by Winon; 11-23-2012 at 12:07 PM. Reason: Forgot to add the formula.:(

  31. #31
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Hi Winon
    I have ask

    Please Login or Register  to view this content.

    can edit code if cell AD change to No
    change

    Please Login or Register  to view this content.
    To past Value

  32. #32
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Automatically change cell value based on other cell value

    Hello etheer,

    Have you changed your Workbook layout?

    I am totally confused with you referencing Column I which is Empty, and where does Column "AD" come from now, or do you actually mean Columns A & D?

    Maybe it would be better if you upload your "New" sample WorkBook again so that we can have a look at it for you.

  33. #33
    Registered User
    Join Date
    12-09-2011
    Location
    saudia
    MS-Off Ver
    Excel 2010
    Posts
    44

    Re: Automatically change cell value based on other cell value

    Hi Winon
    Why only code works when the show sheet if hidden or do not show it the code does not work

+ 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