Board logo

標題: [發問] 核取方塊重新配置位置問題 [打印本頁]

作者: caichen3    時間: 2012-7-2 14:04     標題: 核取方塊重新配置位置問題

請教各位大大
需求陳述-插入按鈕
如何將核取方塊往下移呢??
如果我點選B5,按下插入,如何將 B5以下核取方塊往下移呢?
插入程式碼
Dim gyou As Integer
Dim xR As Range
Dim OB As OLEObject
Dim x As Integer
Dim k As Integer
Dim xxx As String
With ActiveSheet
If ActiveCell.Column = 2 Then
gyou = Selection.Row
Cells(gyou, "A").Resize(, 12).Insert xlDown
Cells(gyou, "A").Resize(, 12).Insert xlDown

Range("M1").Value = Range("M1").Value + 2
x = gyou
Range(Cells(x, 2), Cells(x + 1, 2)).MergeCells = True
Range(Cells(x, 4), Cells(x + 1, 6)).MergeCells = True
Set xR = .Cells(x, "C")
For k = 1 To 3
     Select Case k
        Case "1"
        MyStr = "功能性需求"
        Case "2"
        MyStr = "感官性需求"
        Case "3"
        MyStr = "隱藏需求"
     End Select
   
   With xR.Offset(, k)
      Set OB = ActiveSheet.OLEObjects.Add(ClassType:="Forms.CheckBox.1", Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
          OB.Object.Caption = MyStr
          OB.Object.GroupName = OB.TopLeftCell.Row
   End With
Next
End If
xxx = Range("M1").Value + 1
.Range("A1:L" & xxx).Borders.LineStyle = xlContinuous
.Range("A1:L" & xxx).Borders(xlEdgeRight).Weight = 4
.Range("A1:L" & xxx).Borders(xlEdgeBottom).Weight = 4
End With




歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)