Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 1812|回复: 1

根据资料库建立工作薄(有难度)

[复制链接]
发表于 2015-7-26 16:27 | 显示全部楼层 |阅读模式
资料.rar (3.4 KB, 下载次数: 15)
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2015-7-27 10:31 | 显示全部楼层
Sub test()
    Dim A, p, f, i
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    A = Sheets(1).Range("a1").CurrentRegion
    p = ThisWorkbook.Path & "\"

    For i = 2 To UBound(A)
        f = Format(A(i, 1), "000") & "-" & A(i, 2)
        With Sheets(2)
            .[a1].CurrentRegion.Replace "XX", A(i, 2)
            .Copy
        End With

        With ActiveWorkbook
            .SaveAs p & f
            .Close
        End With
    Next i
End Sub

学生库2.rar (8.95 KB, 下载次数: 5)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-5-9 09:47 , Processed in 1.891682 second(s), 13 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表