Re: Macro to Cell

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Don Lloyd (don.lloyd2_at_virgin.net)
Date: 01/11/05


Date: Tue, 11 Jan 2005 08:01:59 GMT

The Sub goes in the Work*** Module

Right-click the *** tab and select View Code.
Select Work*** in the left column and SelectioChange in the right column

regards,
Don

"Ronbo" <Ronbo@discussions.microsoft.com> wrote in message
news:B39EA793-B70E-4986-A959-D7B933364FC6@microsoft.com...
>
>
> "Don Lloyd" wrote:
>
>> Hi,
>> You could use the Worksheet_SelectionChange event.
>>
>> For example, assuming the cell to be D10
>>
>> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>> If Target.Address="$D$10" then
>> MsgBox Target.Address
>> End If
>> End Sub
>>
>> or using row and column numbers
>> Private Sub Worksheet_SelectionChange(ByVal Target As Range)
>> If Target.Row = 10 And Target.Column = 4 Then
>> MsgBox Target.Address
>> End If
>> End Sub
>>
>> In place of the MsgBox, you could enter code or call a macro.
>>
>> Hope that gets you started.
>> Don
>>
>> "Ronbo" <Ronbo@discussions.microsoft.com> wrote in message
>> news:367FCE21-ED7C-47CB-82DD-605C6E83C53D@microsoft.com...
>> > How do I assign a macro to a cell so that when one clicks on it a
>> > Listbox
>> > opens or a macro runs?
>> >
>> > Thanks
>>
>>
>
> I want the click on the cell to call a ListBox. Where does the "Private
> Sub
> Work***" go?? In the UserForm/ListBox code, in the *** or where??
>
> Thanks for your help.
>>


Quantcast