我有一个代码“copyMultFiles”将许多文件中的许多值移动到单个文件 我的问题是不能在“Const”中使用参数
错误此行“Const csMyPath As String = vaFiles1” vaFiles1是获取源文件夹我无法在csMypath中输入
'get source folder
Dim diaFolder As FileDialog
Dim vaFiles1 As String
' Open the file dialog
Set diaFolder = Application.FileDialog(msoFileDialogFolderPicker)
diaFolder.AllowMultiSelect = False
diaFolder.Show
'MsgBox diaFolder.SelectedItems(1)
vaFiles1 = diaFolder.SelectedItems(1)
' change these to suit requirements
Const csMyPath As String = vaFiles1
Const csMyFile As String = "*.xls" 'source search pattern
Const csSRng As String = "$B$5,$G$36,$I$36,$G$37,$I$37" 'source range
Const csTRng As String = "$A$1" 'target range