Home > Excel Tutorial > Run The Macro with “F9 Key”.

Run The Macro with “F9 Key”.

Starting macro with key (F9) of keyboard.
MsgBox opens when the F9 key is pressed.The number of data in A’s column displayed on the msgbox.

The workbook codes  as follows:

Sub Auto_Open()
Application.OnKey “{F9}”, “Show”
End Sub

Sub Show()
MsgBox “The number of data in A’s column : ” & WorksheetFunction.CountA(Columns(“A”))
End Sub

Template Download Here

running macro with a key

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: