Home > Excel Tutorial > Trigger Macro When A Specific Cell Is Selected

Trigger Macro When A Specific Cell Is Selected

In this example, the background color of the cells was painted different colors with  macros.

When the cells in specific range (between AR4 and AR28 cells) are selected,the macros are triggered :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

Select Case Target.Address

Case “$AR$4”: Call col_one

Case “$AR$5”: Call col_two

Case “$AR$6”: Call col_three

Case “$AR$7”: Call col_four

End Sub

Can Be Downloaded Here

  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: