Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / March 2008

Tip: Looking for answers? Try searching our database.

Validation cell in UDF?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Allen - 03 Mar 2008 23:19 GMT
I want to use a user-defined function as part of a cell validation routine.
Is there a way from within the function to determine what cell is
being validated?

Does anyone have examples of something similar?

Thanks,

-- Greg
Bob Phillips - 04 Mar 2008 00:06 GMT
Greg,

Try

Application.Caller.Address

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

>I want to use a user-defined function as part of a cell validation routine.
> Is there a way from within the function to determine what cell is
[quoted text clipped - 5 lines]
>
> -- Greg
Greg Allen - 05 Mar 2008 15:51 GMT
That does work.

However, what I want to do is a little different.

I want to use a list validation type. In the range of cells that defines the
list, I want to put a formula that will do some validation. In that formula,
I need to know the address of the cell being validated.

Using Application.Caller.Address in this case gives me the cell that
is part of the validation range.

Is there a way to get the cell being validated?

Thanks,

-- Greg

> Greg,
>
[quoted text clipped - 12 lines]
>>
>> -- Greg
Bob Phillips - 05 Mar 2008 16:42 GMT
Just use the reference of the activecell when you add the DV, Excel will
update to each appropriately.

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> That does work.
>
[quoted text clipped - 31 lines]
>>>
>>> -- Greg
Greg Allen - 06 Mar 2008 16:27 GMT
Well, I am close to what I want.  Thanks for the help.

I created a named range for my validation, A1:A7,  (called MyValidate) that
looks like this:

Blocked
In Progress
Listed
N/A
Not Started
Submitted
=CheckInteger()

The CheckInteger function simply check to see if the number in the current
active cell
is a whole number.

I set validation for a cell, choose the type of list, and set the source to
be "=MyValidate"

This almost works.

However, it appears that CheckInteger is not being called when the
validation is occuring.
What happens is that CheckInteger is evaluated when I enter the formula, and
a 0 appears there.
The 0 appears in my dropdown (with all my other options) when I edit the
cell, and if I enter a 0
it works.  But if I enter any other number, it fails.

Can I somehow force validation to "run" this formula each time validation
occurs?  Or can
I get this to happen some other way?

Thanks,

-- Greg

> Just use the reference of the activecell when you add the DV, Excel will
> update to each appropriately.
[quoted text clipped - 34 lines]
>>>>
>>>> -- Greg
Bob Phillips - 06 Mar 2008 17:00 GMT
Greg,

I wouldn't do it like that. Before I make a suggestion, can I check my
understanding. Do you want the list to include the result of that
CheckInteger function, or something else? I assume it just returns true or
False?

Signature

---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

> Well, I am close to what I want.  Thanks for the help.
>
[quoted text clipped - 72 lines]
>>>>>
>>>>> -- Greg
Greg Allen - 06 Mar 2008 18:16 GMT
No, what I want is to validate that the value in the cell is either:

1) one of the items in the list (and I would like the user to see the
dropdown), or
2) a whole number

This is really a combination of two existing validation types, the "whole
number"
validation and the "list" validation.

-- Greg

> Greg,
>
[quoted text clipped - 79 lines]
>>>>>>
>>>>>> -- Greg
Greg Allen - 10 Mar 2008 02:36 GMT
Bob,

Did you still have a suggestion after learning what I am looking for?

Thanks,

-- Greg

> No, what I want is to validate that the value in the cell is either:
>
[quoted text clipped - 91 lines]
>>>>>>>
>>>>>>> -- Greg

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.