Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49888

[SOLVED] Trouble with sub that runs on pressing enter after modifying cell's content

$
0
0
I have the following sub which is designed to run another sub, "mySub", once I change the value of cell H10:

Code:

Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("$H$10")) Is Nothing Then
    mySub
    End If
End Sub

mySub basically goes to another workbook, modifies some values in it and comes back to the workbook where mySub resides. If I run mySub by itself, it runs fine, but if I attempt to activate it with the code above, it seems to run on a loop, going back and fourth between the two workbook endlessly. Any clues as to why? I used this code before and it worked well.

Thanks.

Viewing all articles
Browse latest Browse all 49888

Trending Articles