View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Applying formulae to cells???

Try something like the following:

Sub AAA()
Dim F As String
Dim Rng As Range
F = InputBox("Enter A Formula")
If F < "" Then
For Each Rng In Selection.Cells
Rng.Formula = F
Next Rng
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"index" wrote in message
...

Is it possible to create a macro that when a selection of cells

is
picked and the macro run a box will appear on the screen which

allows
the user to enter a formula which is then applied to all the

cells
selected and the new value returned in the original cells?

ie i highlight cells a1, a2, a3... click the macro. A box

appears
prompting me to enter a formula of my choosing to apply to the
selection. On clicking OK the formula is applied and the new

values
returned to a1, a2, a3

Apologies if this is really simple!!! And thanks in advance for

any
help


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from

http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide

to creating financial statements