0

Actually using the following code is impossible, because we are doing a change in Worksheet_Change

Private Sub Worksheet_Change(ByVal Target As Range) Target.Value = "test" End Sub

It will make an unlimited loop in the event

I must change the target only in this event

Do you have a solution to resolve this problem?

1
  • 2
    Since you are working with Worksheet_Change, I recommend that you see THIS post. Commented Dec 25, 2023 at 5:50

1 Answer 1

2

Use Application.EnableEvents = False to prevent Excel from recognizing the change event.

Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False Target.Value = "test" Application.EnableEvents = True End Sub 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.