一年365天每天一张表格如何快速复制到一张表格中
答案:1 悬赏:40 手机版
解决时间 2021-03-31 10:44
- 提问者网友:放下
- 2021-03-30 23:06
一年365天每天一张表格如何快速复制到一张表格中
最佳答案
- 五星知识达人网友:酒醒三更
- 2021-03-31 00:25
365确实有点多,手工复制很累的,可以写宏来复制,例如下面的代码:
Option Explicit
Sub YgB()
Dim st As Worksheet, stNew As Worksheet, i
Workbooks.Add
Set stNew = ActiveSheet
i = 1
For Each st In ThisWorkbook.Sheets
stNew.Cells(i, 1) = st.Name
st.UsedRange.Copy stNew.Cells(i, 2)
i = stNew.UsedRange.Rows.Count + 1
Next st
End Sub测试的原始文件(两个表):
生成的新文件:
Option Explicit
Sub YgB()
Dim st As Worksheet, stNew As Worksheet, i
Workbooks.Add
Set stNew = ActiveSheet
i = 1
For Each st In ThisWorkbook.Sheets
stNew.Cells(i, 1) = st.Name
st.UsedRange.Copy stNew.Cells(i, 2)
i = stNew.UsedRange.Rows.Count + 1
Next st
End Sub测试的原始文件(两个表):
生成的新文件:
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯