返回列表 上一主題 發帖

請問要如何把A1、A2、A3合併至 C1, 文字內容字型、顏色不變。

回復 2# GBKEE
也可以簡化成以下這樣 :
  1. Sub Ex()
  2.     Dim R As Range, i As Integer, ii As Integer
  3.     Dim fS As Font, fT As Font
  4.     [C1].Clear
  5.     [C1] = Join(Application.WorksheetFunction.Transpose([A1:A3]), Chr(10))
  6.     i = 1
  7.     For Each R In [A1:A3]
  8.         For ii = 1 To Len(R)
  9.             Set fS = R.Characters(Start:=ii, Length:=1).Font
  10.             Set fT = [C1].Characters(Start:=i, Length:=1).Font
  11.             With fS
  12.                 fT.Name = .Name
  13.                 fT.FontStyle = .FontStyle
  14.                 fT.Size = .Size
  15.                 fT.Strikethrough = .Strikethrough
  16.                 fT.Superscript = .Superscript
  17.                 fT.Subscript = .Subscript
  18.                 fT.OutlineFont = .OutlineFont
  19.                 fT.Shadow = .Shadow
  20.                 fT.Underline = .Underline
  21.                 fT.ColorIndex = .ColorIndex
  22.             End With
  23.             i = i + 1
  24.         Next
  25.         i = i + 1
  26.     Next
  27. End Sub
複製代碼

TOP

        靜思自在 : 改變自己是自救,影響別人是救人。
返回列表 上一主題