unwanted purchase

  • Hello, I can use the code below in column A. It doesn't work when I use it on the same column E. What changes do I need to make to make it work?



  • Since I said "1 = A" then "5 = E" so these lines of code become:

    Code
    If Target.Column <> 5 Then Exit Sub
    ...
    XDD = Cells(Target.Row + XD - 1, 5).Value
    ...
    Cells(Target.Row + XD - 1, 5).Value = Replace(Cells(Target.Row + XD - 1, 5), krt, "")
  • Start by reading the Forum Rules.


    How is the Thread title supposed to indicate the question?

  • Hello, thank you for the replies. It only works on one column when the relevant change is made. I changed it to work on two columns but I'm getting an error.


    Code
    If Target.Column <> 1 And Target.Column <> 5 Then Exit Sub
  • As said in post #4 you need to change 3 lines of your code to manage a different column or more than one.

    Code
    If Target.Column <> 1 And Target.Column <> 5 Then Exit Sub
    ...
    XDD = Cells(Target.Row + XD - 1, Target.Column).Value
    ...
    Cells(Target.Row + XD - 1, Target.Column).Value = Replace(Cells(Target.Row + XD - 1, Target.Column), krt, "")

Participate now!

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