I am trying to fix a timestamp issue as most have asked about in this forum; however, my question is a little different from the 75+ that have been previously asked.
I have a userform that loops through and adds rows of data to a worksheet (SurvData). In worksheet SurvData, I have a cell that is saved with the data from a dropdown menu on the Userform (Cell G2). In Cell C2, I need the timestamp to be added at the end of a Code that is decided by a formula in worksheet "Sheet1."
The formula for Sheet1 Cell A2) is as follows:
=IF(SurvData!G3="Confined Space Surveillance","C106CS",IF(SurvData!G3="Asbestos Surveillance","C106AP",IF(SurvData!G3="Electrical Frisking","C106EF",IF(SurvData!G3="Fall Protection Surveillance","C106FP",IF(SurvData!G3="Hearing Conservation","C106HC",IF(SurvData!G3="Tracked HM Storage Location","C106HM",IF(SurvData!G3="Hot Work Surveillance","C106HW",IF(SurvData!G3="Hexavalent Chromium","C106HX",IF(SurvData!G3="Hazard Communication","C106HZ",IF(SurvData!G3="Job Safety Analysis","C106JSA",IF(SurvData!G3="Lockout/Tagout Plus","C106LT",IF(SurvData!G3="Operational/Out of Service","C106OOS",IF(SurvData!G3="Lead Surveillance","C106PB",IF(SurvData!G3="Personal Protection Equip","C106PPE",IF(SurvData!G3="Respiratory Protection Surveillance","C106RP",IF(SurvData!G3="Shop Safety Surveillance","C106SI",IF(SurvData!G3="Ship Safety Surveillance","C106SS","")))))))))))))))))×tamp()
The formula used in Cell "C2" is as follows: =IF(A2="","",Sheet1!$A2)
Currently, the result of this is as desired (e.g., C106CS1119180600), with the exception of it overwriting all previously stored timestamps each time the page is opened. I cannot figure out a way to make this formula work and NOT overwrite previous timestamps in the previous rows. Is there a way this can be done VBA that allows me to still use the IF() statement above?
I have a userform that loops through and adds rows of data to a worksheet (SurvData). In worksheet SurvData, I have a cell that is saved with the data from a dropdown menu on the Userform (Cell G2). In Cell C2, I need the timestamp to be added at the end of a Code that is decided by a formula in worksheet "Sheet1."
The formula for Sheet1 Cell A2) is as follows:
=IF(SurvData!G3="Confined Space Surveillance","C106CS",IF(SurvData!G3="Asbestos Surveillance","C106AP",IF(SurvData!G3="Electrical Frisking","C106EF",IF(SurvData!G3="Fall Protection Surveillance","C106FP",IF(SurvData!G3="Hearing Conservation","C106HC",IF(SurvData!G3="Tracked HM Storage Location","C106HM",IF(SurvData!G3="Hot Work Surveillance","C106HW",IF(SurvData!G3="Hexavalent Chromium","C106HX",IF(SurvData!G3="Hazard Communication","C106HZ",IF(SurvData!G3="Job Safety Analysis","C106JSA",IF(SurvData!G3="Lockout/Tagout Plus","C106LT",IF(SurvData!G3="Operational/Out of Service","C106OOS",IF(SurvData!G3="Lead Surveillance","C106PB",IF(SurvData!G3="Personal Protection Equip","C106PPE",IF(SurvData!G3="Respiratory Protection Surveillance","C106RP",IF(SurvData!G3="Shop Safety Surveillance","C106SI",IF(SurvData!G3="Ship Safety Surveillance","C106SS","")))))))))))))))))×tamp()
The formula used in Cell "C2" is as follows: =IF(A2="","",Sheet1!$A2)
Currently, the result of this is as desired (e.g., C106CS1119180600), with the exception of it overwriting all previously stored timestamps each time the page is opened. I cannot figure out a way to make this formula work and NOT overwrite previous timestamps in the previous rows. Is there a way this can be done VBA that allows me to still use the IF() statement above?