View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default how to insert a formula?

Good point.
--
Gary''s Student - gsnu200909


"Jacob Skaria" wrote:

Cool...Better to specify text comparison so as to replace upper and lower
case X. ('X' and 'x')

r.Formula = "=" & Replace(r.Value, "x", "*",1,,vbTextCompare)

"Gary''s Student" wrote:

Select the cells you want to convert and run this small macro:

Sub formulator()
For Each r In Selection
r.Formula = "=" & Replace(r.Value, "x", "*")
Next
End Sub

Macros are very easy to install and use:

1. ALT-F11 brings up the VBE window
2. ALT-I
ALT-M opens a fresh module
3. paste the stuff in and close the VBE window

If you save the workbook, the macro will be saved with it.

To remove the macro:

1. bring up the VBE window as above
2. clear the code out
3. close the VBE window

To use the macro from Excel:

1. ALT-F8
2. Select the macro
3. Touch RUN

To learn more about macros in general, see:

http://www.mvps.org/dmcritchie/excel/getstarted.htm

--
Gary''s Student - gsnu200909


"JoeF" wrote:

Hi: I have a collumn of #s such as 80 x 120 and 65 x 100, etc. I need the
actual product of them. I have replaced the "x" with "*" but cannot get the
"=" inserted. Can you suggest somethiong?