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"琛ㄧず褰撳墠媧誨姩鐨勫伐浣滆〃錛屽傛灉瑕佸簲鐢ㄥ埌鍏朵粬宸ヤ綔琛ㄤ笂錛岄渶瑕佹浛鎹㈡垚鐩稿簲鐨勫伐浣滆〃鍚嶇О銆