ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help for applying formula (https://www.excelbanter.com/excel-programming/401282-help-applying-formula.html)

Raan

help for applying formula
 
Hi All,


3*2 3*3
3*2 3*4
3*4 3*4
3*2 3*2
3*5 3*5
3*4 3*4
3*4 3*4
3*5 3*5
3*5 3*5
3*4 3*4
3*4 3*4
3*4 3*4
3*2 3*2
3*3 3*3


I have following kind of data i want to convert the above column into
following , how can i do that

=3*2 =3*3
=3*2 =3*4
=3*4 =3*4
=3*2 =3*2
=3*5 =3*5
=3*4 =3*4
=3*4 =3*4
=3*5 =3*5
=3*5 =3*5
=3*4 =3*4
=3*4 =3*4
=3*4 =3*4
=3*2 =3*2
=3*3 =3*3

Can i do it using the help of macro ?

Regards,
Raan

Ron Coderre

help for applying formula
 
Actually, if you don't have many columns of data to convert
you can do what you want WITHOUT the help of a macro
using this method:

From the Excel Main Menu:
<tools<options<transition
....Check: Transition Formula Entry...Click [OK]

Then...select a column of data
<data<text-to-columns....Click [Finish]
(repeat for the remaining columns)

<tools<options<transition
....UNCheck: Transition Formula Entry...Click [OK]

However, if you prefer a macro...try this:

Sub ConvertToFormula()
Dim cCell As Range
Dim cContents
Dim cNewContents

For Each cCell In Selection.Cells
If cCell.Formula < "" Then
On Error Resume Next
'Get the current cell contents
cContents = cCell.Formula

'Build the new contents
cNewContents = "=" & cContents

'Try using the new contents
cCell.Formula = cNewContents

If IsError(cCell) Then
'Restore the previous contents
cCell.Formula = cContents
End If
End If
Next cCell

End Sub

To use that macro:

Select the range of cell to be impacted.
[ALT]+[F8].....to see the list of available macros
Select ConvertToFormula
Press [ENTER]

Does that help?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)



"Raan" wrote in message
...
Hi All,


3*2 3*3
3*2 3*4
3*4 3*4
3*2 3*2
3*5 3*5
3*4 3*4
3*4 3*4
3*5 3*5
3*5 3*5
3*4 3*4
3*4 3*4
3*4 3*4
3*2 3*2
3*3 3*3


I have following kind of data i want to convert the above column into
following , how can i do that

=3*2 =3*3
=3*2 =3*4
=3*4 =3*4
=3*2 =3*2
=3*5 =3*5
=3*4 =3*4
=3*4 =3*4
=3*5 =3*5
=3*5 =3*5
=3*4 =3*4
=3*4 =3*4
=3*4 =3*4
=3*2 =3*2
=3*3 =3*3

Can i do it using the help of macro ?

Regards,
Raan






mepetey

help for applying formula
 
You literally want to add "=" into each of the cells? or do you want the
calculation to run?

"Raan" wrote in message
...
Hi All,


3*2 3*3
3*2 3*4
3*4 3*4
3*2 3*2
3*5 3*5
3*4 3*4
3*4 3*4
3*5 3*5
3*5 3*5
3*4 3*4
3*4 3*4
3*4 3*4
3*2 3*2
3*3 3*3


I have following kind of data i want to convert the above column into
following , how can i do that

=3*2 =3*3
=3*2 =3*4
=3*4 =3*4
=3*2 =3*2
=3*5 =3*5
=3*4 =3*4
=3*4 =3*4
=3*5 =3*5
=3*5 =3*5
=3*4 =3*4
=3*4 =3*4
=3*4 =3*4
=3*2 =3*2
=3*3 =3*3

Can i do it using the help of macro ?

Regards,
Raan





All times are GMT +1. The time now is 07:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com