我对VBA很新,需要一些项目帮助 . 我需要编写一个宏来读取列C中的工作表名称,并将源工作簿中的值粘贴到目标工作簿中的范围,该范围在列D中指定 .
因此,例如,它需要复制Myworkbook book的Sheet2中的数据,并将其粘贴到他们的工作簿Sheet2的范围内 . 范围和工作表编号信息存储在单独工作簿中的位置 .
编辑:我添加了一张wbOpen的图片 . This is it here.
Option Explicit
Sub PasteToTargetRange()
Dim arrVar As Variant stores all the sheets to get the copied
Dim arrVarTarget As Variant stores names of sheets in target workbook
Dim rngRange As Range each sheet name in the given range
Dim rngLoop As Range Range that rngRange is based in
Dim wsSource As Worksheet source worksheet where ranges are found
Dim wbSource As Workbook workbook with the information to paste
Dim wbTarget As Workbook workbook that will receive information
Dim strSourceFile As String location of source workbook
Dim strTargetFile As Strin