+ Reply to Thread
Results 1 to 3 of 3

Single or Multiple Cell Selection

  1. #1
    PosseJohn
    Guest

    Single or Multiple Cell Selection

    Greetings...
    I have a WS that contains code under 'Private Sub Worksheet_Change(ByVal
    Target As Range)'

    I only want to run the code if the user is changing contents of a single cell.

    How do you detect if the user has selected multiple cells or not?

  2. #2
    Gord Dibben
    Guest

    Re: Single or Multiple Cell Selection

    If Target.Count > 1 Then Exit Sub 'or whatever


    Gord Dibben Excel MVP

    On Sun, 27 Nov 2005 09:17:19 -0800, PosseJohn
    <[email protected]> wrote:

    >Greetings...
    >I have a WS that contains code under 'Private Sub Worksheet_Change(ByVal
    >Target As Range)'
    >
    >I only want to run the code if the user is changing contents of a single cell.
    >
    >How do you detect if the user has selected multiple cells or not?



  3. #3
    PosseJohn
    Guest

    Re: Single or Multiple Cell Selection

    THANX Gord, sometimes the easiest way isn't always obvious.

    "Gord Dibben" wrote:

    > If Target.Count > 1 Then Exit Sub 'or whatever
    >
    >
    > Gord Dibben Excel MVP
    >
    > On Sun, 27 Nov 2005 09:17:19 -0800, PosseJohn
    > <[email protected]> wrote:
    >
    > >Greetings...
    > >I have a WS that contains code under 'Private Sub Worksheet_Change(ByVal
    > >Target As Range)'
    > >
    > >I only want to run the code if the user is changing contents of a single cell.
    > >
    > >How do you detect if the user has selected multiple cells or not?

    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1