I have a coworker who is trying to use a formula to change the sign of a number in column G from positive to negative if anything is entered into the cell in column I of the same row. I've looked around for answers, and it seems that without using helper cells and other workarounds, the answer resides in VBA on the Worksheet_Change() event. I found the following snippet of code which may be a good starting point:
Please Login or Register to view this content.
I made the following changes, as a starting point:
I'm assuming that putting this code in the "this workbook" object is the right location for the code...Please Login or Register to view this content.
Also, I expect a change to the "G9" and "I9" cell references will be needed to make this code work on all rows... I also need it to be universal for the workbook and function on the active sheet, as she makes a new sheet every month for archival purposes.
Let me know if I'm on the right track please. I've attached a sample workbook with the basic layout of the sheet... essentially all values in column G are entered as positives, and adding an "X" in column I (or any other charachter) should change the value in column G to a negative. Clearing the cell in column I should change the number in column G back to a positive.
Please help! Thanks!
Bookmarks