|
测试后没发现有问题。
- Sub ftest11()
- Dim ShpRec, Shp As Shape
- Dim colIndex, Left_position As Integer
- Dim Today As Date
- Set CurSht = Worksheets("工作统计表")
- For Each Shp In CurSht.Shapes '删除页面所有的形状
- Shp.Delete
- Next Shp
- For i = 1 To 15
- rq = Date + i
- Set zhao = CurSht.Rows(6).Find(rq)
- zhao.Select
- Set ShpRec = CurSht.Shapes.AddShape(msoShapeRectangle, zhao.Left, zhao.Top - 1, zhao.MergeArea.Width, 492) '在当前日期处画矩形
- ShpRec.Fill.Visible = msoFalse
- With ShpRec.Line '设置矩形外观
- .ForeColor.RGB = RGB(255, 0, 0)
- .Transparency = 0
- .Weight = 3
- .Visible = msoTrue
- End With
- Next
- End Sub
复制代码 |
|