We’d like our macro to toggle the setting. The first line sets it to R1C1 and the second line sets it to A1 style. In the recorded Excel VBA code, you can see the two lines that change the reference style. The lines that start with an apostrophe are comments, and you can delete them in this example.Click Edit, to see the recorded code, that will look something like this:.In the list of Macros, click ToggleR1C1.With the Macro Recorder on, turn the R1C1 reference style on, then turn it off.Name the macro, ToggleR1C1, and store it in the Personal Macro Workbook. ![]() To see the Excel VBA code that changes the setting, we can use the Excel Macro Recorder. ![]() Step 1: Record a Macro to Switch Column Headings to Numbers ![]() We’ll create a macro that will let us quickly switch from A1 to R1C1, or from R1C1 to A1. That setting is pretty well hidden, and it’s a bit of a pain to switch on and off. ![]() We’ve talked about the Excel Column Headings before, and seen how to change the Reference Style setting from R1C1 (Numbers) to A1 (Letters). It’s Friday, and your brain is almost full, but let’s try to cram a little bit of Excel VBA in there before the weekend.
0 Comments
Leave a Reply. |