|
|
Assign Macro to a Cell
Is there a way to assign a macro to a cell such that clicking (or double
clicking) the cell executes the macro?
Thanks,
RUM
|
|
0
|
|
|
|
Reply
|
Bob
|
12/14/2009 5:47:01 PM |
|
You can pick up either a selction change
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Row=1 and Target.Column=1 then
'do Stuff
End If
End Sub
a double click
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, _
ByVal Target As Range, ByVal Cancel As Boolean)
If Target.Row=1 and Target.Column=1 then
'do Stuff
End If
End Sub
or a right click
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, _
ByVal Target As Range, ByVal Cancel As Boolean)
If Target.Row=1 and Target.Column=1 then
'do Stuff
End If
End Sub
The code would go in VBA on the sheet where your target cell resides and not
a seperate module. Change the Target.Row=1 and Target.Column=1 to whatever
cell you desire.
--
If this helps, please remember to click yes.
"Bob Myers" wrote:
> Is there a way to assign a macro to a cell such that clicking (or double
> clicking) the cell executes the macro?
> Thanks,
> RUM
>
> .
>
|
|
0
|
|
|
|
Reply
|
Utf
|
12/14/2009 6:44:01 PM
|
|
You would probably learn a heck of a lot if you read this:
http://www.cpearson.com/excel/Events.aspx
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.
"Paul C" wrote:
> You can pick up either a selction change
>
> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
> If Target.Row=1 and Target.Column=1 then
> 'do Stuff
> End If
> End Sub
>
> a double click
> Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, _
> ByVal Target As Range, ByVal Cancel As Boolean)
> If Target.Row=1 and Target.Column=1 then
> 'do Stuff
> End If
> End Sub
>
> or a right click
> Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, _
> ByVal Target As Range, ByVal Cancel As Boolean)
> If Target.Row=1 and Target.Column=1 then
> 'do Stuff
> End If
> End Sub
>
> The code would go in VBA on the sheet where your target cell resides and not
> a seperate module. Change the Target.Row=1 and Target.Column=1 to whatever
> cell you desire.
> --
> If this helps, please remember to click yes.
>
>
> "Bob Myers" wrote:
>
> > Is there a way to assign a macro to a cell such that clicking (or double
> > clicking) the cell executes the macro?
> > Thanks,
> > RUM
> >
> > .
> >
|
|
0
|
|
|
|
Reply
|
Utf
|
12/14/2009 7:35:01 PM
|
|
|
2 Replies
1629 Views
(page loaded in 0.051 seconds)
Similiar Articles: Assign Macro to a Cell - microsoft.public.excel.worksheet ...Is there a way to assign a macro to a cell such that clicking (or double clicking) the cell executes the macro? Thanks, RUM ... How to assign PRINT option to execute a macro - microsoft.public ...How can I assign PRINT option to execute a macro, used for printing page numbers in a cell. Macro results a proper answer I require but only on ex... How to I assign a VB Macro to a hyperlink or can I? - microsoft ...Assign macro to a hyperlink - Excel Help Forum How do I assign a macro to a hyperlink? I want to be able to click a hyperlink in a cell and ... I am new to vba and macros ... How can I assign a macro to a button in all documents? - microsoft ...Assign Macro to a Cell - microsoft.public.excel.worksheet ... How can I assign a macro to a button in all documents? - microsoft ... You can also assign this macro to a ... Macro to assign category and move to folder for new emails I send ...Assign Macro to a Cell - microsoft.public.excel.worksheet ... Macro to assign category and move to folder for new emails I send ... Assign Macro to a Cell - microsoft ... Macro to control Print area/view - microsoft.public.excel ...Record a macro and assign to a button. Gord Dibben MS Excel MVP On Fri, 14 May ... alternative solution which was to >create a seccond sheet where sheet 2 cell ... assign a macro to send email in lotus notes from Excel spreadsheet ...Assign Macro to a Cell - microsoft.public.excel.worksheet ... assign a macro to send email in lotus notes from Excel spreadsheet ... I would like to assign a macro button ... If statement in macro to find blank cell/value in another cell ...Trying to find a macro that will allow me to find a blank cell in a column, and if the corresponding cell is populated, then tag that cell with a ce... Read excel file and read in a cell into a var in VBA - microsoft ...... excel file and access an individual cell in that excel file, then assign it ... Read excel file and read in a cell into a var in VBA - microsoft ..... or Macro Help ... Assign numerical value to cell based on selection from drop-down m ...Combo Box Assign Range Name Based On Cell Values; Assign ... public.access ... Assign numerical value ... if there was a way to assign a macro to a combo box or drop down ... How to Assign a Macro to a Cell in Excel | eHow.comA macro is a piece of Visual Basic for Applications (VBA) executable code that you can use to tailor Microsoft Excel to suit your needs. For example, you can write a ... how to assign a macro to an excel cell(click)Hello , thanks for reading I have recorded a macro named "mycalendar". Now i want it to run when ever user clicks on any cell ranging A1:A50. please help ... Assign a Macro to a cell - Excel Help ForumHello all, How can I assign a macro to a cell. What I want to do is be able to, for example, click on cell B2 and have some text appear on cell B10. Is that possible? How to Run a Macro From a Cell | eHow.comHow to Assign a Macro to a Cell in Excel. A macro is a piece of Visual Basic for Applications (VBA) executable code that you can use to tailor Microsoft Excel to... Visual Basic :: Assign Macro When Cell Is ClickedAssign Macro When Cell Is Clicked I have a range of cells (say A3:E3). If the user clicks on any of these I want to bring up an input box. I don't know if I should ... 7/24/2012 9:09:26 AM
|
|
|
|
|
|
|
|
|