How to update cells in a row when a particular cell in the same row is changed

Gib Roberts 0 Reputation points
2023-01-29T18:37:22.82+00:00

I have a 2 page excel file.

Page 1: "List" page has 6 columns and infinite rows

Column names:

A: Date

B: Symbol, Text

C: Source, =TradeSource

D SignalApp, =INDIRECT($C2,TRUE)

E: Pattern, =INDIRECT($D2,TRUE)

F: Cull Date

"Source, App, Pattern" page has various defined ranges for the appropriate dropdowns.

What I am trying to do is, clear values if a cell value is changed. Have done this in other files but the address of the change is always the same.

I have the following:

When I change any cell in TradeList this Private Sub is activated

Private Sub Worksheet_Change(ByVal Target As Range)
    Call Any_Change(Target)
End Sub

and goes to:

Sub Any_Change(ByVal Target As Range)


Dim ColNo As Integer
Dim RowNo As Integer

RowNo = ActiveCell.Row
ColNo = ActiveCell.Column

If ColNo > 5 Or ColNo < 2 Then
    End
End If

If ColNo = 3 Then 'Source has changed
    Cells(RowNo, 4) = ""
    Cells(RowNo, 5) = ""
End If

If ColNo = 4 Then 'Signal App has changed
    Cells(RowNo, 5) = ""
End If

End Sub

The problem is that the routine never stops. If I change the value for Source, "If ColNo = 3" is true or SignalApp, "If ColNo = 4" is true,.....

the system loops between List "Private Sub" and the "Any_Change" Sub and never stops.

Any ideas?

Thanks

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,156 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
4,254 questions
Excel Management
Excel Management
Excel: A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.Management: The act or process of organizing, handling, directing or controlling something.
1,757 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.