ExecuteExcel4Macro to get range/charts from closed workbooks

混江龙づ霸主 提交于 2019-11-30 16:08:12

The following bit of code pulls info from a range in a closed workbook and copies it in the same ranges in the Active Workbook:

    Sub GetRange()
        With Range("A1:D50")                                    'set range to copy from / to.
            .Formula = "='C:\E3_Test\[CC_Data.xlsx]AllData'!A1" 'refers to a workbook, sheet and first cell.
                                                                'It will put the relative references into the target sheet correctly.
            .Value = .Value                                     'changes formula to value.
        End With
    End Sub
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!