Jump to content

Solved: Excel VBA Translation Help


exodius
 Share

Recommended Posts

Hi,
Can someone help me with how to translate this correctly? I've been working on it for a few hours and I just can't quite get it right.

Columns("G:G").Select
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
    Formula1:="=""Purchase"""
Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
With Selection.FormatConditions(1).Font
    .Color = -16383844
    .TintAndShade = 0
End With
With Selection.FormatConditions(1).Interior
    .PatternColorIndex = xlAutomatic
    .Color = 13551615
    .TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False

I think I'll be fine after the .Add line, I just cannot get it to work. Here's what I've been trying:

$oExcel.Selection.FormatConditions.Add(9, 3, "=""Purchase""", '') ;Type:=xlCellValue, Operator:=xlEqual, Formula1:="=""Purchase"""

Any help is definitely appreciated!

Edited by exodius
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...