請幫忙排版效果問題:
寫一個VB宏
Sub AutoAddShape() '楼主要的 可以自己录制宏进行修改A列文字用VBA生成按鈕
lstrow = Worksheets("制作按钮").Range("a65536").End(xlUp).Row
For Each rng In ActiveSheet.Columns(2).Cells
If rng.Row > lstrow Then Exit For
If rng.Value <> "" Then
ActiveSheet.Shapes.AddShape(msoShapeRoundedRectangle, rng.Offset(0, 1).Left, rng.Offset(0, 1).Top, rng.Offset(0, 1).Width, rng.Offset(0, 1).Height).Select
'ActiveSheet.Shapes.AddShape(msoShapeHorizontalScroll, rng.Offset(0, 1).Left, rng.Offset(0, 1).Top, rng.Offset(0, 1).Width, rng.Offset(0, 1).Height).Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(0, 255, 0)
Selection.ShapeRange.Fill.OneColorGradient msoGradientDiagonalUp, 4, 0.23 '陰影
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.25
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoFalse
Selection.Characters.Text = rng.Text
Selection.Name = "宋体"
Selection.HorizontalAlignment = xlCenter
Selection.VerticalAlignment = xlCenter
Selection.Font.Bold = True
Selection.Font.ColorIndex = 25
Selection.OnAction = rng.Offset(0, 2).Text
End If
Next
Sheets("制作按钮").Select
End Sub
[此贴子已经被作者于2006-12-26 2:39:01编辑过]
|