Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Detecting Row Selection

Hi All
Is there a 'simple' way of detecting if a user selects an entire row in a
worksheet that can be used to trigger an event?

I have a need to control users who wish to delete an entire row by way of
the CTRL- sequence.

On another related matter, if a worksheet is protected (all cells) and an
autofilter is in place, is there a way to detect that the user is clicking
the autofilter ?

TIA
--
Cheers
Nigel




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Detecting Row Selection

You can use a worksheet_selectionchange event.

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Target.EntireRow.Address Then
MsgBox "whole row(s) selected"
End If
End Sub

Rightclick on the worksheet tab that should have this behavior and select view
code. Paste this into the code window.

But I'm not sure if that will help.

Maybe you could train them to do a shift-spacebar (to select the entirerow),
then ctrl-hypen.

=======
For #2. Maybe you could tie into the worksheet_calculate event to see what the
filters are.



Nigel wrote:

Hi All
Is there a 'simple' way of detecting if a user selects an entire row in a
worksheet that can be used to trigger an event?

I have a need to control users who wish to delete an entire row by way of
the CTRL- sequence.

On another related matter, if a worksheet is protected (all cells) and an
autofilter is in place, is there a way to detect that the user is clicking
the autofilter ?

TIA
--
Cheers
Nigel


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Detecting absentees gracegift Excel Discussion (Misc queries) 7 December 27th 04 11:35 PM
Detecting a color Duncan Help Excel Worksheet Functions 5 December 9th 04 08:12 PM
Detecting Mac Plataform jose luis Excel Programming 1 September 5th 04 06:20 AM
Detecting if AutoFill was used? Gilroy Excel Programming 2 June 16th 04 08:35 PM


All times are GMT +1. The time now is 10:38 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"