发布网友 发布时间:2022-04-22 04:27
共1个回答
热心网友 时间:2023-07-31 22:10
Sub宏1()Application.ScreenUpdating=FalseRange("C1").SelectActiveCell.FormulaR1C1="=IF(AND(OFFSET(RC1,COLUMN()-2,0)=INDEX(C1,COLUMN()-2),ROW()<5001,ROW()+COLUMN()<5004),COLUMN()-2,"""")"Selection.AutoFillDestination:=Range("C1:IR1"),Type:=xlFillDefaultRange("C1:IR1").SelectSelection.AutoFillDestination:=Range("C1:IR5000"),Type:=xlFillDefaultRange("C1:IR5000").SelectSelection.CopySelection.PasteSpecialPaste:=xlPasteValues,Operation:=xlNone,SkipBlanks_:=False,Transpose:=FalseEndSub