Hi Sudarshan
Have you thought about a worksheet change macro? It means you won't get stuck in an infinite loop. Here's the code
If it's of any interest to you, you could change it here & there to suit your needs
I've attached a working sample for you to play with
In Sheet(1)
In ThisWorkbook sheet. It enters 1 in sheet 1 D4 when workbook opens & deletes the cell when the workbook closes.
The number is used to update the lng value in the change event macro. Change address if you like
In a standard module just for demonstration I put
Delete it if not required. Its only for demo purposes
If anyone can improve on it, I'd be happy to see it. Always keen to learn
Cheers
Phil
Bookmarks