Executing Macro by clicking Cell Contain.

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

RawlinsCross

Active Member
Joined
Sep 9, 2016
Messages
288
Naresh, try this

Code:
If Target.Cells(1).Address = "$A$3" Then
  'enter code here or call macro
End If
 

nareshjoshy

New Member
Joined
Mar 6, 2019
Messages
23
Dear RawlinsCross, Please expalin process of Using this code. Where I Have to Paste and How Can I Executive?
 

RawlinsCross

Active Member
Joined
Sep 9, 2016
Messages
288
Sorry the actual full sub is below. Simply paste this code (what is does or what it calls is left to you) in the worksheet code module that appears in the VBAProject Explorer in the VBA development environment.


Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Cells(1).Address = "$A$3" Then
        'Enter your code or call your macro
    End If

End Sub
 
Last edited:

Watch MrExcel Video

Forum statistics

Threads
1,099,802
Messages
5,470,864
Members
406,732
Latest member
Micka77

This Week's Hot Topics

Top