|
- Sub 设置()
- Dim MN As Object
- On Error Resume Next
- Application.ScreenUpdating = False
- PS = ""
- Set MN = ActiveSheet.Shapes("QZ")
- If Not MN Is Nothing Then
- pass.Show
- If PS <> "1268" Then Exit Sub '密碼
- End If
- UJM
- ActiveSheet.Shapes("QZ").Delete
- Set G = ActiveSheet.GroupBoxes.Add(20, 10, 582, 40)
- G.Characters.Text = "签 字 栏"
- G.Name = "G1"
- ActiveSheet.Shapes.AddShape(msoShapeRectangle, 19.8, 9.8, 581.5, 39.5).Select
- Selection.ShapeRange.ZOrder msoSendToBack
- Selection.ShapeRange.Fill.ForeColor.SchemeColor = 29
- Selection.ShapeRange.Fill.Solid
- Selection.ShapeRange.Line.Visible = msoFalse
- Selection.Name = "G2"
- ARR = Array("制表", "审核", "批准") '標籤名
- For I = 1 To 3
- Set G = ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Left:=70 + 188 * (I - 1), Top:=22, Width:=48, Height:=20)
- G.Name = "B" & I * 2 - 1
- G.Object.BackColor = &HE0E0E0 ' 框中顯示名稱底色
- G.Enabled = False
- Set G = ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Left:=115 + 188 * (I - 1), Top:=22, Width:=65, Height:=20)
- G.Name = "B" & I * 2
- G.Object.BackColor = &HE0E0E0 ' 框中顯示日期底色
- G.Enabled = False
- Set G = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1", Left:=30 + 188 * (I - 1), Top:=25, Width:=38, Height:=16)
- G.Name = "L" & I
- G.Object.Caption = ARR(I - 1)
- With G.Object.Font
- .Name = "標楷體"
- .Size = 14
- .ColorIndex = 5
- '.Bold = True
- End With
- G.Object.ForeColor = &H400000 '標識名字體顏色
- G.Object.BackColor = &H8080FF '標籤名背景底色
- Next
- ZH
- ActiveSheet.Range("D3").Select
- Selection = 0
- Application.ScreenUpdating = True
- End Sub
复制代码
- 此用贴地址(44楼):http://www.excelpx.com/thread-183575-5-1.html
复制代码 敬请各路英雄,帮我看看,以上图片中的问题,如何修正,谢谢~~
‘
本帖最后由 zjdh 于 2011-8-14 14:18 编辑
增加一个变量WID,你只要改变WID的值即可:
Sub 设置()
Dim MN As Object
On Error Resume Next
Application.ScreenUpdating = False
PS = ""
Set MN = ActiveSheet.Shapes("QZ")
If Not MN Is Nothing Then
密码验证.Show
If PS <> "12345" Then Exit Sub '密码
End If
UJM
ActiveSheet.Shapes("QZ").Delete
WID = 220
Set G = ActiveSheet.GroupBoxes.Add(20, 10, WID * 2 + 205, 40)
G.Characters.Text = "签 字 栏"
G.Name = "G1"
ActiveSheet.Shapes.AddShape(msoShapeRectangle, 19.8, 9.8, WID * 2 + 204.5, 39.5).Select
Selection.ShapeRange.ZOrder msoSendToBack
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 41
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Line.Visible = msoFalse
Selection.Name = "G2"
ARR = Array("制表:", "审核:", "批准:") '标签名
For I = 1 To 3
Set G = ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Left:=70 + WID * (I - 1), Top:=23, Width:=70, Height:=20)
G.Name = "B" & I * 2 - 1
G.Object.BackColor = &HC000&
G.Enabled = False
Set G = ActiveSheet.OLEObjects.Add(ClassType:="Forms.TextBox.1", Left:=142 + WID * (I - 1), Top:=23, Width:=70, Height:=20)
G.Name = "B" & I * 2
G.Object.BackColor = &HC000&
G.Enabled = False
Set G = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Label.1", Left:=32 + WID * (I - 1), Top:=28, Width:=38, Height:=21)
G.Name = "L" & I
G.Object.Caption = ARR(I - 1)
With G.Object.Font
.Name = "隶书"
.Size = 12
End With
G.Object.ForeColor = &HFF0000
G.Object.BackColor = &HFFFFC0
Next
ZH
ActiveSheet.Range("D3").Select
Selection = 0
Application.ScreenUpdating = True
End Sub
|
|