Automatically change cell value based on other cell value

  • Re: Automatically change cell value based on other cell value


    i mean


    now when i change in sheet M2
    change cell F in M1 and change cell J to yes but code do not work
    if i change normal cell F change cell J to yes and work code
    i need work code when i change in sheet M2

  • Re: Automatically change cell value based on other cell value


    [Blocked Image: http://im29.gulfup.com/Nv7n1.jpg]





    please help me Mumps


    i need If in cell G Number no past again new number from cell A to cell G

  • Re: Automatically change cell value based on other cell value


    Try:


    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Automatically change cell value based on other cell value


    Hi Mumps
    you can help me
    i want code play sound when cell j change to yes
    you can edit it please





    file sound


    C:\windows\media\ding.wav

  • Re: Automatically change cell value based on other cell value


    Try:

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Automatically change cell value based on other cell value


    Thank you code work with sound 100% really you very smart and very professional
    You always make me very happy :)

  • Re: Automatically change cell value based on other cell value


    Thank you. I'm glad the code worked well for you.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Automatically change cell value based on other cell value


    Hi Mumps :flower:
    Why code do not work when protect excel by password :?


  • Re: Automatically change cell value based on other cell value


    If the sheet is protected, the code cannot make any changes to it. You have to add a line at the beginning of the code to unprotect it:


    Code
    Activesheet. unprotect password:="yourpassword"


    and another line at the end of the code to protect it again:


    Code
    Activesheet. protect password:="yourpassword"


    Replace "yourpassword" with the real password that you are using.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Automatically change cell value based on other cell value



    Out error message

  • Re: Automatically change cell value based on other cell value


    Try:


    [VB]Private Sub Worksheet_Calculate()
    ActiveSheet.Unprotect Password:="1234567"
    Dim c As Range
    Application.EnableEvents = False
    On Error Resume Next
    For Each c In Range("J7:J" & Cells(Rows.Count, "J").End(xlUp).Row)
    If c = "Yes" Then
    c.Offset(, 1).Value = "Yes"
    Application.Speech.Speak ("Yes")
    If c.Offset(, 2) = "" Then
    c.Offset(, 2).Value = c.Offset(, -6).Value
    c.Offset(, 24).Value = c.Offset(, -8).Value
    c.Offset(, 25).Value = c.Offset(, -7).Value
    c.Offset(, 26).Value = c.Offset(, -6).Value
    c.Offset(, 27).Value = c.Offset(, -6).Formula
    c.Offset(, 28).Value = c.Offset(, 39).Formula
    c.Offset(, 29).Value = c.Offset(, 1).Value
    c.Offset(, 30).Value = c.Offset(, 38).Value
    End If
    End If
    Next c
    Application.EnableEvents = True
    ActiveSheet.Protect Password:="1234567"
    End Sub[/VB]

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Automatically change cell value based on other cell value


    Mumps - I admire your patience with this thread, but please edit your post(s), remove the HTML colour tags and replace them with code tags. This is required by the rules here.


    You can add code tags by editing your post, highlighting the code and clicking the '#' button on the edit window toolbar. Alternatively, you can add them manually by typing [noparse]

    Code
    [/noparse][/b] before the start of the code, and [b][noparse]

    [/noparse][/b] after. Note that you must remove the HTML tags are they will not be recognised inside the code tags.


    Thank you

  • Re: Automatically change cell value based on other cell value


    Thank you, cytop, for pointing the error out. I have made the corrections.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Automatically change cell value based on other cell value


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


Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!