Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Checking valus in cells

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Checking valus in cells

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
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.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Checking valus in cells

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



In xl 2000 and xl 97 this would work fine:

? Range("A1,B9,C21,Z65534,M23").address
$A$1,$B$9,$C$21,$Z$65534,$M$23

Range("A1,B9,C21,Z65534,M23").Name = "Scattered"
? range("Scattered").Address
$A$1,$B$9,$C$21,$Z$65534,$M$23


could you clarify your statement. Did you mean scattered across a workbook
as in being on several sheets?

--
Regards,
Tom Ogilvy

"Chris Jensen [MSFT]" wrote in message
...
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.




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
Sum of retuned valus as digits Vinay Vasu New Users to Excel 5 April 22nd 10 09:19 PM
Sum of retuned valus as digits Vinay Vasu Excel Worksheet Functions 1 April 16th 10 10:49 AM
checking two different cells Stefan - AW Excel Worksheet Functions 1 September 7th 09 05:28 PM
extract non zero valus from a list. TUNGANA KURMA RAJU Excel Discussion (Misc queries) 4 June 4th 08 01:01 AM
Checking the Cells in Sheet1 with Cells in Sheet2 and replace Checking the cells in Sheet1 with Sheet2 Excel Worksheet Functions 1 August 19th 06 09:29 AM


All times are GMT +1. The time now is 06:31 AM.

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"