formatcondition,,, curious....

  • Thread starter Thread starter x taol
  • Start date Start date
X

x taol

1.
set rng=[a1:a9]
rng.select
with selection
~~~~abuout formatcondition
end with

2.
set rng=[a1:a9]
with rng
~~~~abuout formatcondition
end with

curiously, number 1 is work out... but, number 2 is not work... why?????
 
Can you post the rest of the code... It is a little tought to comment without
seeing what is failing...
 
rdz.Select
With Selection
.FormatConditions.Delete
If .Resize(.Rows.Count, 1).Count = 1 Then Exit Sub
adr = .Cells(1).Address(0, 0)
adr2 = .Resize(.Rows.Count, 1).Address(1, 0)
.FormatConditions.Add Type:=xlExpression, _
Formula1:="=MAX(" & adr2 & ")=" & adr
.FormatConditions(1).Font.Color = vbRed
.FormatConditions.Add Type:=xlExpression, _
Formula1:="=IF(COUNTIF(" & adr2 & ",0)>0,SMALL(" & adr2 &
",COUNTIF(" & adr2 & ",0)+1)=" & adr & ",MIN(" & adr2 & ")=" & adr & ")"
.FormatConditions(2).Font.Color = vbBlue
End With

the upper source 2 line.... is replaced below follow 1 line.
with rdz

and then, if I run that macro, the adr indicate wrong address curiously.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top