Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Multiple cell selection | Excel Discussion (Misc queries) | |||
Multiple formats in a single cell with multiple formulas | Excel Worksheet Functions | |||
multiple functions in a single cell | Excel Worksheet Functions | |||
Multiple cell selection | Excel Discussion (Misc queries) | |||
multiple validation in a single cell | Excel Discussion (Misc queries) |