Help with Macro

S

Simon S

Hi,

I am new to macros and I need some help

I regularly have to change the reference style from x1A1 to x1R1C1 and back
again. So I made the following macro using Ctrl+Shift+T as the keyboard
short cut

Application.ReferenceStyle = xlR1C1
End Sub

Is there a way I can get it to toggle, i.e. each time I press Ctrl+Shift+T
it will change to other reference style, if I am in x1A1 it will change to
x1R1C1 and vice versa

Thanks
 
R

Rick Rothstein

This single statement will toggle between the two settings...

Application.ReferenceStyle = (xlR1C1 + xlA1) - Application.ReferenceStyle
 
S

Simon S

Rick, Great help, thanks

Rick Rothstein said:
This single statement will toggle between the two settings...

Application.ReferenceStyle = (xlR1C1 + xlA1) - Application.ReferenceStyle
 

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

Top