Re: Macro to Cell
From: Don Lloyd (don.lloyd2_at_virgin.net)
Date: 01/11/05
- Next message: rocket: "Re: using macros to import data"
- Previous message: Claud Balls: "Re: SaveAs Problem"
- In reply to: Ronbo: "Re: Macro to Cell"
- Next in thread: Claud Balls: "Re: Macro to Cell"
- Messages sorted by: [ date ] [ thread ]
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.
>>
- Next message: rocket: "Re: using macros to import data"
- Previous message: Claud Balls: "Re: SaveAs Problem"
- In reply to: Ronbo: "Re: Macro to Cell"
- Next in thread: Claud Balls: "Re: Macro to Cell"
- Messages sorted by: [ date ] [ thread ]