用excel VBA合并工作表后如何直接把函数公式变成数值,以下代码是合并指定位置工作表到一起,求解
SubXXX()DimshtAsWorksheetDimirow&,icol&,Num&Application.ScreenUpdating=FalseForEachsh...
Sub XXX()
Dim sht As Worksheet
Dim irow&, icol&, Num&
Application.ScreenUpdating = False
For Each sht In Sheets
If sht.Name <> "汇总" Then
With sht
irow = .[a65536].End(xlUp).Row
icol = .[iv1].End(xlToLeft).Column
Num = Sheets("汇总").[a65536].End(xlUp).Row
.Range("q7:W100").Copy Sheets("汇总").Cells(Num + 1, 1)
End With
End If
Next
Application.ScreenUpdating = True
End Sub 展开
Dim sht As Worksheet
Dim irow&, icol&, Num&
Application.ScreenUpdating = False
For Each sht In Sheets
If sht.Name <> "汇总" Then
With sht
irow = .[a65536].End(xlUp).Row
icol = .[iv1].End(xlToLeft).Column
Num = Sheets("汇总").[a65536].End(xlUp).Row
.Range("q7:W100").Copy Sheets("汇总").Cells(Num + 1, 1)
End With
End If
Next
Application.ScreenUpdating = True
End Sub 展开
2个回答
展开全部
Sub XXX()
Sheets("汇总").Select
Sheets("汇总").Move Before:=Sheets(1)
Dim sht As Worksheet
Dim irow&, icol&, Num&
Application.ScreenUpdating = False
For N = 2 To Sheets.Count
If Sheets(N).Name <> "汇总" Then
Num = Sheets("汇总").[a65536].End(xlUp).Row
arr = Sheets(N).Range("q7:W100")
Sheets("汇总").Cells(Num + 1, 1) = Sheets(N).Name
Sheets("汇总").Cells(Num + 2, 1).Resize(94, 7) = arr
End If
Next
Application.ScreenUpdating = True
End Sub
试下
更多追问追答
追答
汇总后,用代码批量将a列为空的空行删除
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询