回覆列表
  • 1 # 使用者8852944140293

    先錄製一個宏插一行。

    然後將宏改下,做個迴圈就行。

    比如

    for i=1 to 6000

    if (left(range(“A”& i).value,4)="考點名稱" then

    Rows(i +1& ":" & i+1).Select

    Selection.Insert Shift:=xlDown

    Range("A" & i+1 ":" & i).Select

    With Selection

    .HorizontalAlignment = xlCenter

    .VerticalAlignment = xlCenter

    .WrapText = False

    .Orientation = 0

    .AddIndent = False

    .IndentLevel = 0

    .ShrinkToFit = False

    .ReadingOrder = xlContext

    .MergeCells = False

    End With

    Selection.Merge

    Range("A" & i+1 & ":H" & i+1").Select

    ActiveCell.FormulaR1C1 = "因校內施工…."

    Range("A" & i+2 & ":H" & i+2).Select

    end if

    next i

  • 中秋節和大豐收的關聯?
  • 血檀傢俱的優缺點?