Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
active cell to run macro
Hello,
it is possibel that when in sheet1 a1 cell is active to run macro |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
active cell to run macro
kalpesh wrote:
it is possibel that when in sheet1 a1 cell is active to run macro One way is the Worksheet_SelectionChange event. Place this in the worksheet's class: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If "$A$1" = ActiveCell.Address Then 'your code here End If End Sub If you want your code to run when A1 is the only thing selected, change ActiveCell.Address to Target.Address. -- I can't believe he would even THINK of something like... like... Oh, who the hell am I kidding? Yes I can. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
active cell to run macro
Auric has pointed you to a method use a selection chamge event.
There are other event types you could use if you choose BeforeRightClick BeforeDoubleClick Sample code.............................. Private Sub Worksheet_BeforeDoubleClick( _ ByVal Target As Excel.Range, Cancel As Boolean) Select Case Target.Address(False, False) Case "A1" Cancel = True MyA1Macro Case "B1" Cancel = True MyB1Macro Case "C1" Cancel = True MyC15Macro End Select End Sub Gord On Mon, 06 Feb 2012 11:19:23 -0600, kalpesh wrote: Hello, it is possibel that when in sheet1 a1 cell is active to run macro |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
active cell to run macro
Please make correction to MyC15Macro
Should read MyC1Macro Gord On Mon, 06 Feb 2012 12:11:14 -0800, Gord Dibben wrote: Auric has pointed you to a method use a selection chamge event. There are other event types you could use if you choose BeforeRightClick BeforeDoubleClick Sample code.............................. Private Sub Worksheet_BeforeDoubleClick( _ ByVal Target As Excel.Range, Cancel As Boolean) Select Case Target.Address(False, False) Case "A1" Cancel = True MyA1Macro Case "B1" Cancel = True MyB1Macro Case "C1" Cancel = True MyC15Macro End Select End Sub Gord On Mon, 06 Feb 2012 11:19:23 -0600, kalpesh wrote: Hello, it is possibel that when in sheet1 a1 cell is active to run macro |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro-active cell | Excel Discussion (Misc queries) | |||
run macro although blinking cursor is active in an active cell | Excel Programming | |||
Macro to paste in the active cell the contents of a cell from another file?? | Excel Programming | |||
Run macro in active cell | Excel Programming | |||
Run a macro in the active cell. | Excel Programming |