Catching Ctrl+clicks and getting to the selection

  • Thread starter Thread starter Mac
  • Start date Start date
M

Mac

Hello,
when a user changes the area of a selection (via a Ctrl+click), how do I
intercept this event and after that, how do I get to the selection object and
'read' what's in the selected parts (rows)? Thank you!
 
If you're only interested in a single worksheet, you could use the
Worksheet_selectionchange event.

If you want to try, rightclick on the worksheet tab that should have this
behavior. Select view code and past this into the code window:

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim myArea As Range
For Each myArea In Target.Areas
MsgBox myArea.Address(0, 0)
Next myArea
End Sub

I'm not sure what you're doing, so I just did a message box of the address of
each area.
 

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

Back
Top