
VBA
Sub 填充() Dim i Application.ScreenUpdating = False With Sheet1 .Range(C17).Resize(10, Cells(5, Columns.Count).End(xlToLeft).Column).ClearContents For i = 3 To .Cells(5, Columns.Count).End(xlToLeft).Column .Cells(5, i).Resize(10).SpecialCells(xlCellTypeConstants, 23).Copy .Cells(17, i).PasteSpecial Paste:=xlPasteValues Application.CutCopyMode = False Next .Range(A1).Select End WithEnd Sub注意事项 你看我截图 你打开你的
VBA编辑器,添加一个模块 在模块里粘贴这段代码, 你的内容在sheet1 就把代码里的With后写改成Sheet1 如果在sheet2就写成With Sheet2 注意 你这个sheet1或者sheet2不是你表的名称, 要看工程区 sheet1(sheet1)这个以括号外的sheet为准, 不是括号里的sheet.