Hi all,

Please refer to this condensed/sample workbook Sample.xlsm

I am dealing with a file that is generated through an MIS system. In the file sometimes in column D, MIS will generate the Project number, sometimes however it embedded in the ‘Milestone Name’ column and in some cases it simply isn’t there. I got help to write code that extracts it from Milestone Name if it’s there because it follows a naming convention and can easily be identified.

Now, I would like to have one column with all the Projects numbers in the same spot to use for a pivot table. But I would like to give priority to the ‘MIS project number’ (column D) over what my code finds (column C), this is why I don’t simply let my code paste it over in the same column. Sometimes the project number embedded in the ‘Milestone Name’ string can be wrong, but ‘MIS project number’ (column D) will be never wrong. So if Column D has a number, place it in column E. If Column D doesn’t contain a value, look at column C and place that number in Column E. Now if they both don’t have a value then to place a string saying “Not found” OR “N/A”

If you got anything, thank you so much Cheers