- 帖子
- 5923
- 主題
- 13
- 精華
- 1
- 積分
- 5986
- 點名
- 0
- 作業系統
- win10
- 軟體版本
- Office 2010
- 閱讀權限
- 150
- 性別
- 男
- 來自
- 台灣基隆
- 註冊時間
- 2010-5-1
- 最後登錄
- 2022-1-23
        
|
2#
發表於 2010-7-2 18:09
| 只看該作者
回復 1# child - Sub Ex()
- Dim i&, R As Range, Y%
- i = 2: Y = 1
- With Sheet2
- Do While .Cells(i, "b") <> ""
- Set R = .Cells(i, "b")
- With Sheet1.Cells(i - 1, Y)
- .Value = R & Chr(10) & R(1, 2) & R(1, 3) & R(1, 4) & Chr(10) & Chr(10) & R(1, 5) & Space(20) & R(1, 6) & "收" & Chr(10)
- .ColumnWidth = 33
- .Borders.LineStyle = xlContinuous
- .HorizontalAlignment = xlLeft
- .VerticalAlignment = xlCenter
- .IndentLevel = 1
- End With
- If Y = 3 Then
- Y = 1: i = i + 1
- Else
- Y = Y + 1
- End If
- Loop
- End With
- Sheet1.PrintOut
- End Sub
複製代碼 |
|