如何在excel中用公式将固定列插入到指定列
比如说今天是2号 把2号数据(系统匹配的)插入到2号对应的列,A3插入到D3,A4插入到D4等,如果当前是3号就插入到3号对应的列,A3插入到E3,A4 插入到E4
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
On Error GoTo 100
If Target.Column = 1 Then
x = Application.Match(Range("a2"), Range("c2:ag2"), 0) + 2
n = 3
Do
Cells(n, x) = Cells(n, 1)
n = n + 1
Loop Until Cells(n, 1) = ""
End If
100 Application.EnableEvents = True
End Sub
下一篇:打印牛皮纸的打印机有吗
上一篇:恢复文件不能用
热门标签: