cells(x,y).Borders.LineStyle = xlContinuous ''设置单元格边框
cells(x,y).Borders.ColorIndex = 48 "设置边框颜色
Cells(x,y).Interior.ColorIndex = 48 ' 背景的颜色为色号48
Cells(x,y).Interior.Color = RGB(0, 0, 255) '背景的颜色蓝色
Range(Cells(x, y), Cells(x + 1, y)).Borders.LineStyle = xlContinuous "同时给多行单元格设置边框 本例为给 x行及x的下一行 两行同时添加边框
Range(Cells(x, y), Cells(x + 1, y)).Borders.ColorIndex = 48 "同时给多行单元格设置边框颜色