求大神指教!

如圖,回圈搜索,當單元格的值為BCD時,在前面插入一列,結果圖如下
uj5u.com熱心網友回復:
Sub BCDInsertColumn()
Dim col As Long, lstcol As Long
Const target_row As Long = 3 'BCD所在的行
lstcol = Cells(target_row, Columns.Count).End(xlToLeft).Column
For col = lstcol To 1 Step -1
If Cells(target_row, col) = "BCD" Then
Columns(col).Insert
End If
Next col
End Sub
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/210115.html
標籤:VBA
