The search I ran for "conditional formatting" produced a lot of threads with an unhelpful title, so I've crammed as much detail as I can into the heading.
This is not a question, rather I'm just posting it in case someone else comes up with the same problem. I've found one other reference to this issue on the 'net, but it was unresolved.
Basically, I had a piece of code which was applying Conditional Formatting to Excel cells (which was based on a Formula) but it was changing the row references.
I even tried recording a macro to get the result I wanted, but it still failed.
For example: I recorded the following macro (unnecessary lines deleted):
In the Conditional Formatting dialog for cell A1 I'd have the same formula, but the row number was offset by 3, upwards (kind of) and produced:
It was truly bizarre and seemingly no matter what I did or what combinations I tried, I got the same result. Regardless of which cell I applied the formatting to, the row in the resulting formula was three rows above the one I specified.
Anyway, the resolution appears to be simply to re-start Excel because all that happened yesterday and now it's not happening.
Very strange.
Version of Excel: 2003 SP3 11.8332.8333
VBA Version 6.5.1053
Again, this is not a question - although if anyone else has seen something similar and got a more technical answer/fix than mine, I'd love to hear about it.
This is not a question, rather I'm just posting it in case someone else comes up with the same problem. I've found one other reference to this issue on the 'net, but it was unresolved.
Basically, I had a piece of code which was applying Conditional Formatting to Excel cells (which was based on a Formula) but it was changing the row references.
I even tried recording a macro to get the result I wanted, but it still failed.
For example: I recorded the following macro (unnecessary lines deleted):
Code:
Sub Macro1()
Range("A1").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:="=B3=1"
Selection.FormatConditions(1).Interior.ColorIndex = 3
End Sub
In the Conditional Formatting dialog for cell A1 I'd have the same formula, but the row number was offset by 3, upwards (kind of) and produced:
=B65533=1
It was truly bizarre and seemingly no matter what I did or what combinations I tried, I got the same result. Regardless of which cell I applied the formatting to, the row in the resulting formula was three rows above the one I specified.
Anyway, the resolution appears to be simply to re-start Excel because all that happened yesterday and now it's not happening.
Very strange.
Version of Excel: 2003 SP3 11.8332.8333
VBA Version 6.5.1053
Again, this is not a question - although if anyone else has seen something similar and got a more technical answer/fix than mine, I'd love to hear about it.