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

Perceived Question:
I need to set a constant to a specific value (the string "IN") in a specific
column. I am working with conditional formatting and one of the conditions is
if the constant is "IN" then the formatting will take place, else no
formatting. Here's what I have so far:

Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:=s_current, Formula2:=s_future
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:= CONSTANT THAT EQUALS "IN"
Selection.FormatConditions(1).Interior.ColorIndex = 3

Where I place CONSTANT THAT EQUALS "IN" is, obviously, the value in the
specific column.

I hope I am making myself clear and need help badly. I appreciate any time
and consideration you may provide. As usual, I always get help from you
guys/gals!!!

Thanks,
-m
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Specific Conditional Selection

If I understand your question then you wish to test a condition based on a
value (Constant) within your code. You could use the following, clearly the
value of xConst will always be TRUE in this method, but if some other code
you have is changing this value then referencing the value set works OK

' declare this in your set up module
Public xConst As String
xConst = "IN"


' your code to set conditions on sheet
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:=s_current, Formula2:=s_future
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:=xConst
Selection.FormatConditions(1).Interior.ColorIndex = 3

--
Cheers
Nigel



"mvyvoda" wrote in message
...
Perceived Question:
I need to set a constant to a specific value (the string "IN") in a
specific
column. I am working with conditional formatting and one of the conditions
is
if the constant is "IN" then the formatting will take place, else no
formatting. Here's what I have so far:

Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlBetween, _
Formula1:=s_current, Formula2:=s_future
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:= CONSTANT THAT EQUALS "IN"
Selection.FormatConditions(1).Interior.ColorIndex = 3

Where I place CONSTANT THAT EQUALS "IN" is, obviously, the value in the
specific column.

I hope I am making myself clear and need help badly. I appreciate any time
and consideration you may provide. As usual, I always get help from you
guys/gals!!!

Thanks,
-m



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
change Selection to specific Range Damian Excel Discussion (Misc queries) 0 September 1st 09 09:23 PM
Selection of specific cells FARAZ QURESHI Excel Discussion (Misc queries) 2 April 5th 08 09:40 AM
How to set the entire selection to a specific value without using VBA Koye Li[_2_] Excel Programming 2 December 13th 05 12:28 AM
Specific datapoints selection Metin Charts and Charting in Excel 7 February 19th 05 04:59 AM
specific data selection/pasting Anthony Excel Discussion (Misc queries) 1 January 26th 05 08:53 PM


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