EXCEL高手用VBA画一个太极图案
发布网友
发布时间:2022-10-16 11:54
我来回答
共3个回答
热心网友
时间:2023-10-18 20:24
直接用条件格式就可以完成了,当然了,非要用VBA也行,就把条件格式直接写入代码中就是了。
下面是我直接用条件格式画出的一张简单的图
热心网友
时间:2023-10-18 20:25
Sub test()
'
' 宏1 宏
'
' 成都豺狼
ActiveSheet.Shapes.AddShape(msoShapeArc, 150, 150, 100, 100).Select
Selection.ShapeRange.Name = "Arc1"
Selection.ShapeRange.Adjustments.Item(1) = 180#
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorText1
Selection.ShapeRange.IncrementRotation 90
ActiveSheet.Shapes.AddShape(msoShapeArc, 150, 150, 100, 100).Select
Selection.ShapeRange.Name = "Arc2"
Selection.ShapeRange.Adjustments.Item(1) = 180#
Selection.ShapeRange.Fill.Visible = msoFalse
Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1
Selection.ShapeRange.IncrementRotation 270
ActiveSheet.Shapes.AddShape(msoShapeArc, 150, 150, 50, 50).Select
Selection.ShapeRange.Name = "Arc3"
Selection.ShapeRange.Adjustments.Item(1) = 360#
Selection.ShapeRange.Fill.Visible = msoture
Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1
Selection.ShapeRange.Line.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeArc, 150, 250, 50, 50).Select
Selection.ShapeRange.Name = "Arc4"
Selection.ShapeRange.Adjustments.Item(1) = 360#
Selection.ShapeRange.Fill.Visible = msoture
Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorText1
Selection.ShapeRange.Line.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeArc, 150, 187.5, 12.5, 12.5).Select
Selection.ShapeRange.Name = "Arc5"
Selection.ShapeRange.Adjustments.Item(1) = 360#
Selection.ShapeRange.Fill.Visible = msoture
Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorText1
Selection.ShapeRange.Line.Visible = msoFalse
ActiveSheet.Shapes.AddShape(msoShapeArc, 150, 287.5, 12.5, 12.5).Select
Selection.ShapeRange.Name = "Arc6"
Selection.ShapeRange.Adjustments.Item(1) = 360#
Selection.ShapeRange.Fill.Visible = msoture
Selection.ShapeRange.Fill.ForeColor.ObjectThemeColor = msoThemeColorBackground1
Selection.ShapeRange.Line.Visible = msoFalse
ActiveSheet.Shapes.Range(Array("Arc1", "Arc2", "Arc3", "Arc4", "Arc5", "Arc6")).Select
Selection.ShapeRange.Group.Select
End Sub
热心网友
时间:2023-10-18 20:25
刚画完四边形。。。。又要画太极了。。。。。VB的写法和VBA是不一样的。