PDA

View Full Version : [SOLVED:] inputbox cancel



wilg
12-01-2011, 03:04 PM
I have below code for an input but value, but if inputbox is x'd or cancel selected it put's in no value deleting what was in there. Can this be modified to leave current value if inputbox is closed or cancel selected?


ActiveCell.Value = Range("a2").Value & " FISCAL " & InputBox("Key Fiscal")

wilg
12-01-2011, 03:15 PM
with this as well, is there a way to run the inputbox with the current cell value already entered into the input box & selected?

mdmackillop
12-01-2011, 04:53 PM
txt = InputBox("Key Fiscal", , ActiveCell)
If txt <> "" Then
ActiveCell.Value = Range("a2").Value & " FISCAL " & txt
End If

wilg
12-03-2011, 07:47 AM
Thank you. Works