我学习到其中一个加边框的地方的时候,那个语句我怎么也搞不好, Sub WhatsinACell() ' ' WhatsinACell Macro ' 显示单元格里潜在的内容:文本,数字,公式。 ' ' '查找并格式文本单元格 Selection.SpecialCells(xlCellTypeConstants, 2).Select With Selection.Font .FontStyle = "加粗" .ColorIndex = 9 End With Range("B2").Select '查找并格式文本单元格 Selection.SpecialCells(xlCellTypeConstants, 1).Select With Selection.Font .FontStyle = "常规" .ColorIndex = 5 End With Range("B4").Select Selection.SpecialCells(xlCellTypeFormulas, 23).Select With Selection.Font .FontStyle = "加粗" .ColorIndex = 3 End With '创建图例 Range("A1:A3").EntireRow.Insert Range("A1").Select With Selection.Interior .ColorIndex = 9 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With Range("B1").Select ActiveCell.FormulaR1C1 = "文本" Range("A2").Select With Selection.Interior .ColorIndex = 5 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With Range("B2").Select ActiveCell.FormulaR1C1 = "数字" Range("A3").Select With Selection.Interior .ColorIndex = 3 .Pattern = xlSolid .PatternColorIndex = xlAutomatic End With Range("B3").Select ActiveCell.FormulaR1C1 = "公式" range("A1:B3").BorderAround weight:=xlThick 4 这句总是出错。 Range("B4").Select End Sub
|