|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
- Sub Test()
- Dim shSource As Worksheet
- Dim arr As Variant, strTemp As String, strSplit() As String
- Dim intLen As Integer, lngRow As Long
-
- Set shSource = Sheets("Sheet1")
- lngRow = shSource.Range("A" & Rows.Count).End(xlUp).Row
-
- arr = shSource.Range("A1:A" & lngRow)
- For lngRow = 2 To 21
- strTemp = arr(lngRow, 1)
- strSplit = Split(strTemp, Chr(10))
- intLen = Len(strSplit(0))
- With shSource.Range("A" & lngRow).Characters(1, intLen).Font
- .Bold = True
- .Size = 14
- End With
- Next
-
- End Sub
复制代码 |
|