how to switch off R1C1 reference style in Excel 2007

只愿长相守 提交于 2019-12-19 10:32:43

问题


i'm using excel-2007. i wanted to see smth with R1C1, then i checked the "R1C1 Reference Style" (office button->Excel Options->Formulas->R1C1 Reference Style)...

Now i wanted to move again back to xlA1 style, i unchecked the R1C1 Reference Style, but my macros are still written in the R1C1 style... how can i switch to xlA1 reference style so that my macros again written in the xlA1 style? thanks

i tried recording macros again it does not work!


回答1:


You will have to manually edit the code [scratch out]or record the macros again[/scratch out].


EDIT:

The Office Button>Excel Options>Formulas>R1C1 Reference Style option only applies to the reference style as it appears in a cell on a spreadsheet.

With the R1C1 reference style off, I recorded a macro in which cell "A2" is initially selected. After the recorder starts, I enter the following forumla into "A2": =A1+12, press enter and stop the recorder. The recorded code is:

ActiveCell.FormulaR1C1 = "=R[-1]C+12"
Range("A3").Select

With the R1C1 reference style on, the code looks exactly the same:

ActiveCell.FormulaR1C1 = "=R[-1]C+12"
Range("A3").Select

The reason is that macro recorder always stores the formula in the FormulaR1C1 property of the ActiveCell object.

One would have to manually edit the code like this to be in xlA1 style:

ActiveCell.FormulaR1C1 = Range("A1").Value + 12



回答2:


Go in to the file menu->option->formula-> then uncheck r1c1 reference style



来源:https://stackoverflow.com/questions/1018751/how-to-switch-off-r1c1-reference-style-in-excel-2007

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!