FormatConditions Formula1 differences between 2003 and 2007

Luis Garcia

New Member
Joined
Jun 8, 2010
Messages
3
Step1: Select range 'A1:B5'
Step2: Fill with numbers
Step3: Apply this FormatCondition:
Formula '=A1=2', with Red Font.

Then, all cells with contains number 2 are Red.

Step4: Select cell 'B2'

In VBA, Excel 2003:
Msgbox ActiveCell.FormatConditions(1).Formula1 shows:
'=B2=2'

In VBA, Excel 2007:
Msgbox ActiveCell.FormatConditions(1).Formula1 shows:
'=A1=2'

I have a Worksheet with ALL depends of this behavior!!!
I evaluate '.Formula1' for each cell in range, but in XLS2007 evaluates wrong values!!!

I need Help ;)
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
You can use this:
acell = ActiveCell.Address
ifor = Range("B1").Address
Formula_res = Application.ConvertFormula(Application.ConvertFormula(ActiveSheet.Range(acell).FormatConditions(1).Formula1, xlA1, xlR1C1, , Range(ifor)), xlR1C1, xlA1, xlAbsolute, ActiveSheet.Range(acell))


Where acell is your activecell, and ifor is the initial cell where you aplicate the formula for all your range of format condition (at the sample you give is A1).

With this, formula_res will give you the formula of the conditional format for your activecell.

Hope this help.
 
Upvote 0

Forum statistics

Threads
1,215,254
Messages
6,123,893
Members
449,131
Latest member
leobueno

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top