help for applying formula

  • Thread starter Thread starter Raan
  • Start date Start date
R

Raan

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
 
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)
 
You literally want to add "=" into each of the cells? or do you want the
calculation to run?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top