|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
本帖最后由 fxl447098457 于 2017-3-10 11:40 编辑
有一个文件标题货号多了一列,与其他的两个文件不一致。自己注意。
- Sub hebing()
- Dim fn As String, arr As Variant, ss As String, brr As Variant, Rng As Range
- Application.ScreenUpdating = False
- If Not IsEmpty(UsedRange) Then UsedRange.ClearContents
- fn = Dir(ThisWorkbook.Path & "\*.xlsx")
- arr = Array("文件名", "品牌名称", "商品排位", "货号", "货号", "款式细类", _
- "正品价", "售价 ", "材质", "售卖周期", "总备货量", "备货值(货值)", _
- "总销售额(未扣满减未扣拒退)", "总销售量(未扣拒退)", "库存量", _
- "销售额(扣满减未扣拒退)", "满减金额", "uv", "客单价", "转化率", "购买人数", _
- "售卖比", "售罄状态", "sku售罄率", "三级分类销售量", "三级分类销售额", _
- "三级分类售卖比", "第一天销售量", "第一天售卖比", "推荐等级", "拒收量", _
- "拒收率", "拒收金额", "退货量", "退货率", "退货金额", "拒退量", "拒退率", _
- "拒退额", "移动端销售量", "移动端销售额", "移动端销售量占比", _
- "移动端销售额占比", "移动端UV", "移动端购买人数", "移动端转化率", "移动端UV占比")
- [a1].Resize(, UBound(arr) + 1) = arr
- Do While Len(fn)
- With Workbooks.Open(Filename:=ThisWorkbook.Path & "" & fn)
- ss = Split(.Name, ".xls")(0)
- brr = Intersect(.Sheets(1).UsedRange, .Sheets(1).UsedRange.Offset(1))
- Set Rng = Cells(Rows.Count, 1).End(3)(2)
- Rng(, 2).Resize(UBound(brr), UBound(brr, 2)) = brr
- Rng.Resize(UBound(brr)) = ss
- .Close 0
- End With
- fn = Dir
- Loop
- Application.ScreenUpdating = True
- Set Rng = Nothing
- End Sub
复制代码
|
|