A. vba 鍋囧侰鍒楁湁鍐呭规椂锛孋鍒楀埌K鍒楄嚜鍔ㄥ悎骞跺崟鍏冩牸鐨勪唬鐮佹庝箞鍐欙紵
涓嬮潰鏄涓绉嶄娇鐢 VBA 瀹炵幇鑷鍔ㄥ悎骞 C 鍒楀埌 K 鍒楃殑浠g爜绀轰緥锛
Sub MergeCells()
Dim i As Long
For i = 1 To ActiveSheet.UsedRange.Rows.Count
If ActiveSheet.Cells(i, 3).Value <> "" Then
ActiveSheet.Range(Cells(i, 3), Cells(i, 11)).Merge
End If
Next i
End Sub
杩欐典唬鐮佷細鍦ㄥ惊鐜涓妫鏌ユ瘡涓琛岀殑 C 鍒楁槸鍚︽湁鍐呭癸紝濡傛灉鏈夛紝鍒欎細灏 C 鍒楀埌 K 鍒楃殑鍗曞厓鏍煎悎骞躲
娉ㄦ剰锛氫笂闈㈢殑浠g爜涓锛"ActiveSheet"琛ㄧず褰撳墠娲诲姩鐨勫伐浣滆〃锛屽傛灉瑕佸簲鐢ㄥ埌鍏朵粬宸ヤ綔琛ㄤ笂锛岄渶瑕佹浛鎹㈡垚鐩稿簲鐨勫伐浣滆〃鍚嶇О銆