如何将变量插入Excel文件名?

时间:2019-07-19 13:54:00

标签: excel vba

'我想将变量“ plant”插入列出的“ 3032”的任何位置:

Sub rulescreate()
    plant = Trim(CStr(Cells(7, 8).Value))


    Workbooks.Open Filename:="C:\Users\js7158\Desktop\HealthCheck\3032.xlsx"
    Windows("3032.xlsx").Activate
        Range("A1:R17").Select
        Selection.Copy
        Windows("healthcheck.xlsm").Activate
        Sheets("Key").Select
        Range("A1").Select
        ActiveSheet.Paste
    Windows("3032.XLSX").Close SaveChanges:=False

0 个答案:

没有答案