Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Wrong output


Hi,

when I want to get the operator from a conditional format in Excell
the formula returns a:

"1" for "between
"5" for greather than
...

The formula I use is

Cells(Row, 2) = Cell.FormatConditions(1).Operator

with

Cell As Range

Is this a wrong declaration or do I have to change something else in m
formula.

Thanks
Steve

--
Steven E
-----------------------------------------------------------------------
Steven E.'s Profile: http://www.excelforum.com/member.php...fo&userid=1512
View this thread: http://www.excelforum.com/showthread.php?threadid=26845

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Wrong output

Hi Steven,

Steven E. wrote:
when I want to get the operator from a conditional format in Excell,
the formula returns a:

"1" for "between
"5" for greather than
..

The formula I use is

Cells(Row, 2) = Cell.FormatConditions(1).Operator

with

Cell As Range

Is this a wrong declaration or do I have to change something else in
my formula.


Not quite sure what you're looking for. If you want the actual operator
(ie, "", "<", "=", "between"), you'll have to write it back based on the
constant returned from the Operator property. Here's an example of a
user-defined function:

Public Function GetCFOperator(rngTarget As Range, _
Optional nCFIndex As Integer = 1) As Variant
On Error GoTo ErrHandler

Select Case rngTarget.FormatConditions(nCFIndex).Operator
Case xlLess
GetCFOperator = "<"
Case xlGreater
GetCFOperator = ""
Case xlBetween
GetCFOperator = "between"
Case xlEqual
GetCFOperator = "="
Case Else
GetCFOperator = "other"
End Select

ExitRoutine:
Exit Function
ErrHandler:
GetCFOperator = CVErr(1004)
Resume ExitRoutine
End Function


--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]

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
Need help for getting output balurrpr Excel Discussion (Misc queries) 2 April 15th 10 10:12 AM
Wrong output returned during IF function jb333 Excel Worksheet Functions 3 March 16th 09 04:44 PM
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
Output to CSV sanjay Excel Programming 1 February 8th 04 07:28 PM
Getting output from an excel output back to cscript.. J S Excel Programming 0 January 21st 04 09:06 PM


All times are GMT +1. The time now is 03:56 PM.

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"