View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default InputBox default value?

Lunks,

1:

Dim myVal As Variant
myVal = Application.InputBox("Enter a value", _
"My Input", "Default Value")
MsgBox myVal


2:

You need the doubled-up double quotes to tell Excel that they are to be put into the formula. No
way around it.

HTH,
Bernie
MS Excel MVP


"Lunks" wrote in message
oups.com...
Hi, I'd like to make an input box pop up with a default value on it,
that should be stored in a variable, and that any information on this
would then be inserted on a cell like an excel formula.
Questions a
1. How to make an inputbox pop up with a default value?
2. How to insert a formula on a cell like it was inserted in excel and
not vba?
VBA Style: ActiveCell.FormulaR1C1 = _
"=IF(PedidosImp!RC[-29]="""",REPT(""
"",25),TEXT(PedidosImp!RC[-26],""0000000,00""))"
I'd like to insert a formula like:
=IF(PedidosImp!F1="";REPT(" ";25);TEXT(PedidosImp!I1;"0000000,00"))

Without that extra quoting.

Thanks in advance!