Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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
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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default 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
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
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
Multiple cell selection Joe Palazzo Excel Discussion (Misc queries) 8 October 10th 08 02:41 PM
Multiple formats in a single cell with multiple formulas Zakhary Excel Worksheet Functions 1 May 2nd 08 12:08 AM
multiple functions in a single cell John C. Excel Worksheet Functions 3 March 14th 08 07:35 PM
Multiple cell selection KB Excel Discussion (Misc queries) 0 May 25th 07 04:53 PM
multiple validation in a single cell whowatwerwyhow Excel Discussion (Misc queries) 5 April 15th 05 02:37 PM


All times are GMT +1. The time now is 09:13 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"