Erdin? E. Ka
09-25-2006, 08:36 PM
Hi everyone!:hi:
I try to change ALT Key's function to "%" by the codes below, but i should missed something or there is something wrong that i can't understand. :dunno
While i closing the workbook i am getting a MsgBox as;
Run-time error-'1004':
Method 'OnKey' of object '_Application' failed
And i click to Debug then YellowLine on; Auto_Close's : Application.OnKey "{ALT}" Row.
Code To Module1;
Sub Auto_Open()
Application.OnKey "{ALT}", "Change_ActiveCell_Value_As_Percent"
End Sub
Sub Change_ActiveCell_Value_As_Percent()
ActiveCell.Value = "%"
End Sub
Sub Auto_Close()
Application.OnKey "{ALT}"
End Sub
Can somebody tell me where is the mistake? Or what should be my correct solution?
Thanks a lot.:)
I try to change ALT Key's function to "%" by the codes below, but i should missed something or there is something wrong that i can't understand. :dunno
While i closing the workbook i am getting a MsgBox as;
Run-time error-'1004':
Method 'OnKey' of object '_Application' failed
And i click to Debug then YellowLine on; Auto_Close's : Application.OnKey "{ALT}" Row.
Code To Module1;
Sub Auto_Open()
Application.OnKey "{ALT}", "Change_ActiveCell_Value_As_Percent"
End Sub
Sub Change_ActiveCell_Value_As_Percent()
ActiveCell.Value = "%"
End Sub
Sub Auto_Close()
Application.OnKey "{ALT}"
End Sub
Can somebody tell me where is the mistake? Or what should be my correct solution?
Thanks a lot.:)