請問要如何把A1、A2、A3合併至 C1, 文字內容字型、顏色不變。
- 帖子
- 835
- 主題
- 6
- 精華
- 0
- 積分
- 915
- 點名
- 0
- 作業系統
- Win 10,7
- 軟體版本
- 2019,2013,2003
- 閱讀權限
- 50
- 性別
- 男
- 註冊時間
- 2010-5-3
- 最後登錄
- 2025-7-5
|
回復 2# GBKEE
也可以簡化成以下這樣 :- Sub Ex()
- Dim R As Range, i As Integer, ii As Integer
- Dim fS As Font, fT As Font
- [C1].Clear
- [C1] = Join(Application.WorksheetFunction.Transpose([A1:A3]), Chr(10))
- i = 1
- For Each R In [A1:A3]
- For ii = 1 To Len(R)
- Set fS = R.Characters(Start:=ii, Length:=1).Font
- Set fT = [C1].Characters(Start:=i, Length:=1).Font
- With fS
- fT.Name = .Name
- fT.FontStyle = .FontStyle
- fT.Size = .Size
- fT.Strikethrough = .Strikethrough
- fT.Superscript = .Superscript
- fT.Subscript = .Subscript
- fT.OutlineFont = .OutlineFont
- fT.Shadow = .Shadow
- fT.Underline = .Underline
- fT.ColorIndex = .ColorIndex
- End With
- i = i + 1
- Next
- i = i + 1
- Next
- End Sub
複製代碼 |
|
|
|
|
|
|
|