Hi all,
I need a VBA code in excel for the following:
If I use “inputbox” and I want the text in a cell, there are two buttons. Ok and cancel.
If I fill in text and click ok. The text will be filled in in the cell. Thats good. If I leave the text empty and click ok, the cell will be empty. Thats good. Now I have a problem with the cancel button. If I click cancel, the cell will be set to empty even if there is already a value in this cell. Thats not good. I would like to have a code that if I click cancel then the inputbox doesnt need to do anything and it does not need to empty the cell cell. If there is already a value in this cell and I click cancel. The value still needs to be in that cell instead of emptying.
How can control the cancel button?
How can I make this happen with a vba code?
Thank you
Jurg
I need a VBA code in excel for the following:
If I use “inputbox” and I want the text in a cell, there are two buttons. Ok and cancel.
If I fill in text and click ok. The text will be filled in in the cell. Thats good. If I leave the text empty and click ok, the cell will be empty. Thats good. Now I have a problem with the cancel button. If I click cancel, the cell will be set to empty even if there is already a value in this cell. Thats not good. I would like to have a code that if I click cancel then the inputbox doesnt need to do anything and it does not need to empty the cell cell. If there is already a value in this cell and I click cancel. The value still needs to be in that cell instead of emptying.
How can control the cancel button?
How can I make this happen with a vba code?
Thank you
Jurg