Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Use function in xll in conditional formatting

Hello

Is there any way to directly use a function in an xll in the formula for
conditional formatting? If I try to enter the formula I get an error
message: "You may not use references to other worksheets or workbooks for
Conditional Formatting criteria.". The only way I could get it to work was
to use a vba function that calls into the xll.

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use function in xll in conditional formatting

For a range on another sheet, you can create a defined name that refers to
that range, then use the defined name in conditional formatting. You might
try the same thing with the xll function.

--
Regards,
Tom Ogilvy

"Dirk" <dirk.kapusta@reply_in_newsgroup wrote in message
...
Hello

Is there any way to directly use a function in an xll in the formula for
conditional formatting? If I try to enter the formula I get an error
message: "You may not use references to other worksheets or workbooks for
Conditional Formatting criteria.". The only way I could get it to work was
to use a vba function that calls into the xll.

Thanks




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Use function in xll in conditional formatting

I'm not sure what you mean. Let's say I have a function xllIsValid in an xll
which is available to the workbook either through the addin manager or
registered in Workbook_Open.
I enter the following formula in conditional formatting:
=NOT(xllIsValid(E13:E18)) // make font red
Then I get the mentioned error.

If I enter:
=NOT(vbaIsValid(E13:E18)) // make font red
everything works.

vbaIsValid is defined in a Module of the current workbook
Function vbaIsValid(rng as Range) as Variant
vbaIsValid = Application.Run ("xllIsValid", rng)
End Function

So I don't think the range is the problem because it is from the current
worksheet.


"Tom Ogilvy" wrote in message
...
For a range on another sheet, you can create a defined name that refers to
that range, then use the defined name in conditional formatting. You

might
try the same thing with the xll function.

--
Regards,
Tom Ogilvy

"Dirk" <dirk.kapusta@reply_in_newsgroup wrote in message
...
Hello

Is there any way to directly use a function in an xll in the formula for
conditional formatting? If I try to enter the formula I get an error
message: "You may not use references to other worksheets or workbooks

for
Conditional Formatting criteria.". The only way I could get it to work

was
to use a vba function that calls into the xll.

Thanks






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Use function in xll in conditional formatting

I didn't say the range was a problem. You get the same error if you use a
range from another worksheet - so if that approach solves that error, it
might solve your error.

insert = Name = Define
Name: IsValid
Refersto: =NOT(xllIsValid(Sheet1!$E$13:$E$18))

then in conditional formatting
Formula is:

=IsValid

--
Regards,
Tom Ogilvy


"Dirk" <dirk.kapusta@reply_in_newsgroup wrote in message
...
I'm not sure what you mean. Let's say I have a function xllIsValid in an

xll
which is available to the workbook either through the addin manager or
registered in Workbook_Open.
I enter the following formula in conditional formatting:
=NOT(xllIsValid(E13:E18)) // make font red
Then I get the mentioned error.

If I enter:
=NOT(vbaIsValid(E13:E18)) // make font red
everything works.

vbaIsValid is defined in a Module of the current workbook
Function vbaIsValid(rng as Range) as Variant
vbaIsValid = Application.Run ("xllIsValid", rng)
End Function

So I don't think the range is the problem because it is from the current
worksheet.


"Tom Ogilvy" wrote in message
...
For a range on another sheet, you can create a defined name that refers

to
that range, then use the defined name in conditional formatting. You

might
try the same thing with the xll function.

--
Regards,
Tom Ogilvy

"Dirk" <dirk.kapusta@reply_in_newsgroup wrote in message
...
Hello

Is there any way to directly use a function in an xll in the formula

for
conditional formatting? If I try to enter the formula I get an error
message: "You may not use references to other worksheets or workbooks

for
Conditional Formatting criteria.". The only way I could get it to work

was
to use a vba function that calls into the xll.

Thanks








  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Use function in xll in conditional formatting

Thanks a lot, that works great.
Fortunately I don't have to use the complete formula in "Refers to:". It is
enough to use =xllIsValid and then substitute the original name by the
defined named in the formatting formula.
I had already tried something like this after your first reply but forgot
the '=' sign.


"Tom Ogilvy" wrote in message
...
I didn't say the range was a problem. You get the same error if you use a
range from another worksheet - so if that approach solves that error, it
might solve your error.

insert = Name = Define
Name: IsValid
Refersto: =NOT(xllIsValid(Sheet1!$E$13:$E$18))

then in conditional formatting
Formula is:

=IsValid

--
Regards,
Tom Ogilvy


"Dirk" <dirk.kapusta@reply_in_newsgroup wrote in message
...
I'm not sure what you mean. Let's say I have a function xllIsValid in an

xll
which is available to the workbook either through the addin manager or
registered in Workbook_Open.
I enter the following formula in conditional formatting:
=NOT(xllIsValid(E13:E18)) // make font red
Then I get the mentioned error.

If I enter:
=NOT(vbaIsValid(E13:E18)) // make font red
everything works.

vbaIsValid is defined in a Module of the current workbook
Function vbaIsValid(rng as Range) as Variant
vbaIsValid = Application.Run ("xllIsValid", rng)
End Function

So I don't think the range is the problem because it is from the current
worksheet.


"Tom Ogilvy" wrote in message
...
For a range on another sheet, you can create a defined name that

refers
to
that range, then use the defined name in conditional formatting. You

might
try the same thing with the xll function.

--
Regards,
Tom Ogilvy

"Dirk" <dirk.kapusta@reply_in_newsgroup wrote in message
...
Hello

Is there any way to directly use a function in an xll in the formula

for
conditional formatting? If I try to enter the formula I get an error
message: "You may not use references to other worksheets or

workbooks
for
Conditional Formatting criteria.". The only way I could get it to

work
was
to use a vba function that calls into the xll.

Thanks












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
conditional formatting in an IF function? Melvin Tang[_2_] Excel Worksheet Functions 1 December 18th 08 01:08 PM
Conditional formatting on a function James Silverton[_2_] Excel Discussion (Misc queries) 3 March 7th 08 08:19 PM
Conditional formatting with IF function Michael Excel Discussion (Misc queries) 1 May 29th 07 05:38 AM
Conditional Formatting with IF function mpenkala Excel Worksheet Functions 0 November 30th 06 04:02 PM
Conditional Formatting (IF function) Neo1 Excel Worksheet Functions 5 March 2nd 06 10:38 PM


All times are GMT +1. The time now is 12:26 PM.

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"