Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Evaluating cells for items in list

I am looking for some help with code to evaluate a cell.
When I evaluate a cell, if it contains one of 15 accounts,
I have to evaluate another cell (same row, column b) to be
sure it (the second cell) is not empty. If it (the second
cell) is empty, then a message will be displayed in column
K.

The part I'm having trouble with is the syntax to see if
the first cell (account) is either 101, 102, 105, 107..etc.

I could string together a bunch of If / Or statements but
there must be a better way. Thanks for the help.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Evaluating cells for items in list

Two alternatives:
1. hardcoding the accounts (faster to run, less flexible):
dim acct(15)
acct(1) = 101
acct(2) = 102
acct(3) = 105
....
acct(15) = ...

for i = 1 to 15
if range(evaluated cell).value = acct(1) then
'code to do what I want
exit for
end if
next


2. keeping the target accounts in another sheet,
say "Lookup", range A1:A15 (slower in execution, much more
flexible in changing target accounts and / or number
thereof):

chk = range(evaluated cell).value
sheets("Lookup").select
range("A1").select
do while isempty(activecell) = false
if activecell.value = chk then
'code to do what I want
exit do
end if
loop

Nikos

-----Original Message-----
I am looking for some help with code to evaluate a cell.
When I evaluate a cell, if it contains one of 15

accounts,
I have to evaluate another cell (same row, column b) to

be
sure it (the second cell) is not empty. If it (the

second
cell) is empty, then a message will be displayed in

column
K.

The part I'm having trouble with is the syntax to see if
the first cell (account) is either 101, 102, 105,

107..etc.

I could string together a bunch of If / Or statements but
there must be a better way. Thanks for the help.
.

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
Evaluating a group of cells John Excel Discussion (Misc queries) 3 July 10th 08 02:53 PM
Changing items in cells that are filled using Data Validation List akkrug New Users to Excel 2 July 1st 08 01:03 PM
evaluating text of cells [email protected] Excel Discussion (Misc queries) 1 January 22nd 08 07:03 PM
I have a question about adding information to a list of items that have cells linked to another worksheet. Marc Excel Discussion (Misc queries) 1 July 9th 06 05:27 AM
If formula evaluating 2 cells contents N E Body Excel Worksheet Functions 3 August 17th 05 06:54 PM


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