Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default I don't get it, Whats going on here?

What's wrong here?

I'm adding validation to say 3 cells using dropdown boxes.
To do this I'm using Named Ranges like so:

List1 (Category)
Communications
Customer Inquiry
Equipment

List2 (CustomerInquiry)
Dispatched Call
Follow-up
Informational

List3 (Followup)
30 Day Follow-up
60 Day Follow-up
90 Day Follow-up

To do this I use INDIRECT() to look at the previous cell
to find the name of the list to use for the current cells validation.

Named Ranges can't have spaces, or special chars in them
i.e.: " " or "-"
So I named the ranges by removing them. "Follow-up" =
"Followup"

Now, to find the right name you would normal use
=INDIRECT(SUBSTITUE(A1, "-", ""))
Which works fine, but I need to use a regular expression to remove
specific patterns of chars.
To do this I made a user defined function called REReplace(sPattern,
sTest, sReplacement)
The function works great if, lets say, I use it like =REReplace(A1,
"&amp:", "")
The result is exactly what you would expect.
************
HOWEVER!!
************
When I nest it inside INDIRECT() like =INDIRECT(REReplace(A1,
"&amp:", ""))
The validation dialog box tells me I'm dumb and won't let me enter
it.

Why is it that I can use
=INDIRECT(SUBSTITUE(A1, "-", ""))
but not
=INDIRECT(REReplace(A1, "&amp:", ""))
when I can use
=REReplace(A1, "&amp:", "")
just fine?

I've gotten a test case to work by setting up an intermediate cell to
store the conversion like
cell1 = REReplace(A1, "[^A-Za-z0-9]", "")
cell2 = INDIRECT(cell1)
But besides being a sloppy workaround, it's impractical for this
project.

Does anyone have any Ideas on what's going on here?
And maybe on how to fix it?

I'd appresiate the help
Shaun Kohanowski

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I don't get it, Whats going on here?

My guess is that it takes two levels of evaluation and that doesn't work in
data validation.

That has been my experience anyway.

You might want to post this over in WorksheetFunctions and see if they have
a better explanation for you.

--
Regards,
Tom Ogilvy

"CodeSponge" wrote in message
ups.com...
What's wrong here?

I'm adding validation to say 3 cells using dropdown boxes.
To do this I'm using Named Ranges like so:

List1 (Category)
Communications
Customer Inquiry
Equipment

List2 (CustomerInquiry)
Dispatched Call
Follow-up
Informational

List3 (Followup)
30 Day Follow-up
60 Day Follow-up
90 Day Follow-up

To do this I use INDIRECT() to look at the previous cell
to find the name of the list to use for the current cells validation.

Named Ranges can't have spaces, or special chars in them
i.e.: " " or "-"
So I named the ranges by removing them. "Follow-up" =
"Followup"

Now, to find the right name you would normal use
=INDIRECT(SUBSTITUE(A1, "-", ""))
Which works fine, but I need to use a regular expression to remove
specific patterns of chars.
To do this I made a user defined function called REReplace(sPattern,
sTest, sReplacement)
The function works great if, lets say, I use it like =REReplace(A1,
"&amp:", "")
The result is exactly what you would expect.
************
HOWEVER!!
************
When I nest it inside INDIRECT() like =INDIRECT(REReplace(A1,
"&amp:", ""))
The validation dialog box tells me I'm dumb and won't let me enter
it.

Why is it that I can use
=INDIRECT(SUBSTITUE(A1, "-", ""))
but not
=INDIRECT(REReplace(A1, "&amp:", ""))
when I can use
=REReplace(A1, "&amp:", "")
just fine?

I've gotten a test case to work by setting up an intermediate cell to
store the conversion like
cell1 = REReplace(A1, "[^A-Za-z0-9]", "")
cell2 = INDIRECT(cell1)
But besides being a sloppy workaround, it's impractical for this
project.

Does anyone have any Ideas on what's going on here?
And maybe on how to fix it?

I'd appresiate the help
Shaun Kohanowski



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default I don't get it, Whats going on here?

hehe
I went and popped into the WorksheetFunctions group and reposted the Q.
It looks like that group has seen better days.
For the last so many months its been lucky to get a post every other
day.
Hope some one has the time to reading it. ;)

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default I don't get it, Whats going on here?

It should be worksheet.Functions

This replaced the old WorksheetFunctions and conformed with internet
standards. Sorry about the confusion.
news://msnews.microsoft.com/microsof...heet.functions


--
Regards,
Tom Ogilvy


"CodeSponge" wrote in message
ups.com...
hehe
I went and popped into the WorksheetFunctions group and reposted the Q.
It looks like that group has seen better days.
For the last so many months its been lucky to get a post every other
day.
Hope some one has the time to reading it. ;)



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
whats it do Curt Excel Discussion (Misc queries) 14 April 13th 07 07:53 PM
Whats wrong with this? LucasBuck Excel Discussion (Misc queries) 3 January 12th 06 08:15 PM
Whats the best way to... Azrael Excel Worksheet Functions 0 September 13th 05 04:51 AM
Whats the best way to... Azrael Excel Worksheet Functions 0 August 18th 05 05:33 AM
Whats the best way to... Azrael Excel Worksheet Functions 1 August 16th 05 09:01 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"