A
associates
Hi,
How do i write a code in VB to define names for cells in excel?
The following is the code i use but doesn't work.
worksheets("Data").Names.Add Name:="myF4",
RefersToR1C1:="=Sheet1!R4C4"
worksheets("Data").FormatConditions.Add Type:=xlCellValue,
Operator:=xlGreater, Formula1:="50"
worksheets("Data").FormatConditions(1).Interior.ColorIndex = 6
worksheets("Data").FormatConditions.Add Type:=xlCellValue,
Operator:=xlLess, Formula1:="50"
worksheets("Data").FormatConditions(2).Interior.ColorIndex = 42
Thank you for your help.
How do i write a code in VB to define names for cells in excel?
The following is the code i use but doesn't work.
worksheets("Data").Names.Add Name:="myF4",
RefersToR1C1:="=Sheet1!R4C4"
worksheets("Data").FormatConditions.Add Type:=xlCellValue,
Operator:=xlGreater, Formula1:="50"
worksheets("Data").FormatConditions(1).Interior.ColorIndex = 6
worksheets("Data").FormatConditions.Add Type:=xlCellValue,
Operator:=xlLess, Formula1:="50"
worksheets("Data").FormatConditions(2).Interior.ColorIndex = 42
Thank you for your help.