Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, and thanks in advance for any help....
This is for an Excel 2000 macro. I have a query input box where the user can type in a query. I have a macro that will run that query, but I don't know how to let the user activate it. I want the user to be able to activate the query macro in either of two ways: By typing in the input box and pressing Enter, or by clicking on the "Find" button next to the input box. The Input Box is simply merged cells in the worksheet (cell G9 on the "UserPage"), not a pop up box. I have no idea how to make the Enter key active the query macro, and I'm having trouble getting the button to activate it. The Excel help file says this (to run a macro from a button): "Right-click a selection handle for the button or graphic control, and then click Assign Macro on the shortcut menu.". The problem is that option doesn't exist in the shortcut menu. Any help would be greatly appreciated. Jim ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You need to use events.
For Enter: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Range("G9").Address Then 'code here... End If End Sub For Find button: Private Sub Find_Click() 'code here... End Sub Either one of these will need to be placed on the Sheet Code. Hope this helps... Chong Moua -----Original Message----- Hi, and thanks in advance for any help.... This is for an Excel 2000 macro. I have a query input box where the user can type in a query. I have a macro that will run that query, but I don't know how to let the user activate it. I want the user to be able to activate the query macro in either of two ways: By typing in the input box and pressing Enter, or by clicking on the "Find" button next to the input box. The Input Box is simply merged cells in the worksheet (cell G9 on the "UserPage"), not a pop up box. I have no idea how to make the Enter key active the query macro, and I'm having trouble getting the button to activate it. The Excel help file says this (to run a macro from a button): "Right-click a selection handle for the button or graphic control, and then click Assign Macro on the shortcut menu.". The problem is that option doesn't exist in the shortcut menu. Any help would be greatly appreciated. Jim ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create a user input query so it can be added on the switchboard? | Excel Discussion (Misc queries) | |||
With QUERY how to input a variable | Excel Discussion (Misc queries) | |||
List Box Input to query | Excel Discussion (Misc queries) | |||
Input box query | Excel Discussion (Misc queries) | |||
Input boxes in excel and MS Query | Excel Discussion (Misc queries) |