View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pfsardella@yahoo.com.nospam is offline
external usenet poster
 
Posts: 172
Default macro to expdite editing cell

Try me.

Sub CreateFormula()
Dim dblNum As Double, dblAdd As Double

dblAdd = Application.InputBox("Please enter the number to add.",
Type:=2)

If Not ActiveCell.HasFormula Then
dblNum = ActiveCell.Value
ActiveCell.Formula = "= " & dblNum & "+" & dblAdd & ""
Else
ActiveCell.Formula = ActiveCell.Formula & "+" & dblAdd
End If

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

I ran it but ran into a snag

works fine if just have a single number in cell

but if have this "=47.25+4.375" & say add 4.5 to it

it puts this in cell

= 51.625+4.5 It is adding the two original numbers
together then adding my new number to the back of it

I probably did not clarify

if I have 47.25+4.375 already in cell and want to add 4.5
to it then when done that action I need the cell to have
the following in it:

"=47.25+4.375+4.5

In the cell to start with I may have one number or there
may be up to 3 or 4 numbers added together with + signs
between them.

Thanks