|
本帖最后由 yayahzmeng 于 2017-1-17 11:30 编辑
- Sub 导入()
- Application.ScreenUpdating = False
- Dim arr, brr, crr, sh
- arr = Range("a1:a" & [a1].End(4).Row)
- brr = Range("b1:b" & [a1].End(4).Row)
- crr = Range("e1:e" & [a1].End(4).Row)
- sh = Application.InputBox("需要导入到哪一天?", "目标", , , , , , 1)
- If sh <> False Then
- For i = 1 To Sheets.Count
- If Sheets(i).Name = sh & "日" Then
- Exit For
- Else
- Sheets.Add.Name = sh & "日": Exit For
- End If
- Next
- With Sheets(sh & "日")
- .[a1].Resize(UBound(arr), 1) = arr
- .[b1].Resize(UBound(brr), 1) = brr
- .[c1].Resize(UBound(crr), 1) = crr
- End With
- End If
- Application.ScreenUpdating = True
- End Sub
复制代码 |
|