【高分求解】vb代码麻烦帮我转成C#的
Sub 重复值() ActiveWindow.SmallScroll Down:=-9 Columns("B:C").Select Selection.FormatConditions.AddUniqueValues Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority Selection.FormatConditions(1).DupeUnique = xlDuplicate With Selection.FormatConditions(1).Font .Bold = True .Italic = False .Color = -16776961 .TintAndShade = 0 End With Selection.FormatConditions(1).StopIfTrue = FalseEnd Sub
public class test{ public void 重复值() {[color=#FF0000] ActiveWindow.SmallScroll Down = -9; //注意这句在线翻译不能翻,所以我自己写的,不确定准确否[/color] Columns("B:C").Select(); Selection.FormatConditions.AddUniqueValues(); Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority(); Selection.FormatConditions(1).DupeUnique = xlDuplicate; { Selection.FormatConditions(1).Font.Bold = true; Selection.FormatConditions(1).Font.Italic = false; Selection.FormatConditions(1).Font.Color = -16776961; Selection.FormatConditions(1).Font.TintAndShade = 0; } Selection.FormatConditions(1).StopIfTrue = false; }}