View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chris Jensen [MSFT] Chris Jensen [MSFT] is offline
external usenet poster
 
Posts: 6
Default Checking valus in cells

Hello Niklas,

With Excel versions before Excel 2002 no single range can contain cells
scattered over a worksheet.

There is a WorksheetChange event that fires when a cell's contents change.
When Excel calls that it provides the range as a "target".
In the Worksheet.Change procedure you can use the

Select Case testexpression
[Case expressionlist-n
[statements-n]] ...
[Case Else
[elsestatements]]
End Select

VBA/VB command to test the target to determine whether it is one of the
cells you are managing.
There is a similar event that fires on Worksheet.SelectionChange
and another for Workbook.SelectionChange which receives the Worksheet
reference and the range reference.
--------------------
Message-ID:
Date: Thu, 07 Aug 2003 21:34:43 -0500
From: Dave Peterson
Reply-To:
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Checking valus in cells
References:
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: microsoft.public.excel.programming
NNTP-Posting-Host: 1Cust13.tnt2.belvidere.il.da.uu.net 67.200.45.13
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.excel.programming:404997
X-Tomcat-NG: microsoft.public.excel.programming

Maybe you could select your cells and give it a nice range name. Then you

could
use that range name in your code.



Niklas wrote:

Hi
I have a sheet with several cells that I want to check if
they are valid or not. At the moment I have predefined
cells which I check, but I do not like that solution. I
want a more dynamic one. Is it possible to "tag" thoose
cells I want to check and with some code retrive those
taged cells as a Range? I want the "taged" cells to appear
all over the sheet?
Regards
/Niklas


--

Dave Peterson



Regards,
Chris Jensen[MSFT]

This posting is provided “AS IS” with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
<http://www.microsoft.com/security.