easycapital
asked on
Keyboard short cuts to run macros
Below are two set of macros; to make selected cells absolute and relative respectively. I want to add them to the XSTART location so that it forms part of the macros that are available to be used. What exactly needs to be done so that a keyboard short cut will run either one. I had this working before, but I do not recall how it was done.
Thanks,
JP
Thanks,
JP
Sub MakeRowAbsolute()
Dim rngCell As Range
For Each rngCell In Selection
rngCell.Formula = Application.ConvertFormula(rngCell.Formula, xlA1, xlA1, xlAbsRowRelColumn)
Next rngCell
End Sub
Sub MakeRelative()
Dim rngCell As Range
For Each rngCell In Selection
rngCell.Formula = Application.ConvertFormula(rngCell.Formula, xlA1, xlA1, xlRelative)
Next rngCell
End Sub
Sub setKey()
Application.OnKey "^+%4", "MakeRowAbsolute"
End Sub
What is "^+%4"?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Rorya, Good point. Though I want to assign my macros a Control, Shift, Alt PLUS another key - to help avoid other macros (of course, it may still conflict, but it is a start).
Could try to make it so that upon hitting Control + Shift + Alt + 4, it makes the selected cells absolute, then the second time, it makes the selected cells relative.
I am very interested start to manage my own set macro short cuts.
Thanks,
JP
Could try to make it so that upon hitting Control + Shift + Alt + 4, it makes the selected cells absolute, then the second time, it makes the selected cells relative.
I am very interested start to manage my own set macro short cuts.
Thanks,
JP
ASKER
Thanks,
JP
JP
ASKER
The first link mentions to place the file in the XLSTART directory - but to avoid depending on the IT department to save it there, I am telling excel to run files in a directory chosen by me. I can explain where I do this in excel if necessary. How can I have the embedded file run from that location specified in excel.
Please verify that the macro sets the values as absolute, then it removes the absolute reference if run again.
Thanks,
JP M---Row-anchors-then-remove-it-.xls