Automatically change cell value based on other cell value

  • Re: I Need help macro


    Hello etheer. For some reason your spreadsheet reads right to left instead of left to right. Is this the way you want it? By the way, some of your "Yes" entries in column D are typed with a lowercase "y". Change them all to uppercase "Y" or the code won't work properly. If that's a problem, let me know and we change the code so that it is not case sensitive. Try the following code:


    [VB]
    Sub Test()
    Application.ScreenUpdating = False
    Dim c As Range
    For Each c In Range("J:J")
    If c = "Yes" Then
    c.Offset(0, 1) = c
    c.Offset(0, 2) = c.Offset(0, -6)
    End If
    Next c
    Application.ScreenUpdating = True
    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: I Need help macro


    I ran the code on your file (attached) and it worked properly. Open the file and click the button. Is this what you were looking for? Please let me know.

    Files

    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: I Need help macro


    I used in cell j Function if
    I need when change yes in cell J past yes in cell K


    and past cell D to L


    Automatic

  • Re: I Need help macro


    I have this code


    but not work with
    Function if
    you can edit it and work with Function if

  • Re: I Need help macro


    Hello etheer. Open the attached file and enter "Yes" or "No in column J. I have added the code as a Worksheet Change event. Hopefully, this is what you were looking for. Please let me know how it works out.

    Files

    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


    Hello etheer,


    Welcome to Ozgrid.
    Please take time to read the forum rules, especially regarding thread titles and use of code tags.


    Thread titles are used in searching the forum so they must accurately describe your thread. "I need help macro" is not a descriptive title and is on no use if used as a search phrase. I have changed your title for you.


    Also,


    All VBA code posted in the forum must be wrapped in code tags, which you omitted, including single-line code snippets.
    I've added the tags for you this time only. Be sure to use them in future posts.


    [COLOR="navy"]How to use code tags[/COLOR]


    [noparse]

    Code
    [/noparse]
    [COLOR="navy"]your code goes between these tags[/COLOR]
    [noparse]

    [/noparse]


    Or, just highlight all of the code and press the [COLOR="#FF0000"]#[/COLOR] button to add the code tags

  • Re: I Need help macro


    Quote from Mumps;635974

    Hello etheer. Open the attached file and enter "Yes" or "No in column J. I have added the code as a Worksheet Change event. Hopefully, this is what you were looking for. Please let me know how it works out.



    Thank you very much Mumps
    But do not work with Function if

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


    Hi again etheer. Try the attachment again. If this is still not what you are looking for, you'll have to be more clear in what you would like. Please let me know.

    Files

    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


    Quote from Mumps;636051

    Hi again etheer. Try the attachment again. If this is still not what you are looking for, you'll have to be more clear in what you would like. Please let me know.



    Thank you very much Mumps
    Work 100%

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


    I'm happy to see that it worked out 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


    Mumps book3 work good but i not found code
    you can write code here

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


    Hello etheer. There is no code involved. I have placed formulas in the used cells in columns J, K and L. Just click in any cell in these columns and you will see the formula at the top.

    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 Mumps But I Need Code

    Code
    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.ScreenUpdating = False
    If Not Intersect(Target, Range("J:J")) Is Nothing Then
    If Target.Value = "Yes" Then
    Target.Offset(0, 1) = Target
    Target.Offset(0, 2) = Target.Offset(0, -6)
    End If
    End If
    Application.ScreenUpdating = True
    End Sub

Participate now!

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