range onclick?

D

Dennis

Hi,
I want to run a subroutine onclick in an excel worksheet.
More precise: Onclick in any cell I want to check for that
cells properties and then react depending on them.
Please help, how do I get excel to react on every click in
the active sheet.
Dennis
 
D

Dennis

I got it.
sorry to have bothered you for nothing.
But - I´ll be back with more profound questions.

my solution:

"Private Sub Worksheet_SelectionChange(ByVal Target As
Range)"

thanks anyway

dennis
 
H

Haldun Alay

Hi,

You can you worksheet's SelectionChange event (this is just for a single sheet) or if you want to control this event in workbook base, use Workbook's SheetSelectionChange event.

Target variable represents selected cell(s).

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

if target.count=1 then 'check if just one cell selected.
'Do something
end if


End Sub


OR

Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
if target.count=1 then 'check if just one cell selected.
'Do something
end if
End Sub


--
Regards

Haldun Alay

To e-mail me, please remove AT and DOT from my e-mail address.



"Dennis" <[email protected]>, iletide sunu yazdi Hi,
I want to run a subroutine onclick in an excel worksheet.
More precise: Onclick in any cell I want to check for that
cells properties and then react depending on them.
Please help, how do I get excel to react on every click in
the active sheet.
Dennis
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top