This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello all! I have a workbook containing the following code in Private Sub Workbook_Open():
Range("Training!N2:N200").Formula = "=IF(E2="""","""",WORKDAY(E2,3,Data!$B$5:$B$25))"
Range("Training!O2:O200").Formula = "=IF(E2="""","""",WORKDAY(E2,5,Data!$B$5:$B$25))"
Range("Training!P2:P200").Formula = "=IF(E2="""","""",WORKDAY(E2,10,Data!$B$5:$B$25))"
So as most of you will figure out, it simply adds a formula to calculate a date in the cell every time I open the workbook. My issue is that when modifying the workbook, sometimes I purposely override the formula in several cells by typing the word "Received". When I save and reopen the workbook, as you'd guess, the script above overrides those cells I modified, and I lose the data that I want to keep as "Received" in those cells and it is replaced with the result of the formula (which are dates)"
I need the above to auto run when opening my workbook only if the word "Received" isn't in a cell (and each independent of the other cells in the same range), and only in my worksheet marked as "Training" (Sheet1). Otherwise, I want to leave it as is with that word.
Any help is greatly appreciated.
Post Details
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/excel/comme...