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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,223,934
Messages
6,175,491
Members
452,649
Latest member
mr_bhavesh

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