Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default how to insert a formula?

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default how to insert a formula?

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default how to insert a formula?

A1 = 80 x 120

In B1 try the formula
=LEFT(A1,SEARCH("x",A1)-1)*MID(A1,SEARCH("x",A1)+1,10)

OR Try this UDF (User Defined function). From workbook launch VBE using
Alt+F11. From menu Insert a Module and paste the below function.Close and get
back to workbook and try the below formula.

=evaltext(A1)

Function EvalText(strData As String) As Variant
EvalText = Evaluate(Replace(strData, "x", "*", 1, 1, vbTextCompare))
End Function


If this post helps click Yes
---------------
Jacob Skaria


"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?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default how to insert a formula?

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?

  #5   Report Post  
Posted to microsoft.public.excel.misc
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?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
insert formula [email protected] Excel Worksheet Functions 0 May 17th 06 12:45 PM
Insert a value into formula Ed Excel Discussion (Misc queries) 5 April 16th 06 06:25 AM
How to insert a formula..but... junkmandan Excel Discussion (Misc queries) 6 January 26th 06 08:17 PM
How to insert = in formula bar Tirtha Raj Adhikari Excel Discussion (Misc queries) 1 September 14th 05 09:02 AM
insert a new row by formula Doug Excel Worksheet Functions 3 November 18th 04 12:28 PM


All times are GMT +1. The time now is 08:40 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"