Selection Formula=FormulaLocal

alfredo sanchez

New Member
Joined
Apr 3, 2003
Messages
42
Hi!
Hope some of you guys can help me with this one:
I'm modifying references in formulas via vba, but when the macro writes back the cells' value, I get #NAME? error. So I'm trying to write back the formula as FormulaLocal in order to my XL version be able to work with it.
This are the lines of code I'm using
Code:
  For i = 1 To c_formls
    If Selection.Cells(i).HasFormula Then
          Selection.Cells(i).Formula = Application.ConvertFormula _
          (Formula:=Selection.Cells(i).Formula, FromReferenceStyle:=xlA1, _
          ToReferenceStyle:=xlA1, ToAbsolute:=xlAbsolute)
    End If
    Next i

c_formls has the number of cells in ActiveSheet that have formula in them

Can you help me to put the FormulaLocal entry in the right place?

Thank you in advance.
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,224,872
Messages
6,181,498
Members
453,047
Latest member
charlie_odd

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top