Các bác cho e hỏi ngu chú ạ (1 người xem)

  • Thread starter Thread starter vutin
  • Ngày gửi Ngày gửi
Liên hệ QC

Người dùng đang xem chủ đề này

vutin

Thành viên mới
Tham gia
30/11/17
Bài viết
1
Được thích
0
Giới tính
Nam
Có bác nào giải thích giúp em từ các câu lệnh dưới này với ạ

Sub copyfiles()
'Updateby Extendoffice
Dim xRg As Range, xCell As Range
Dim xSFileDlg As FileDialog, xDFileDlg As FileDialog
Dim xSPathStr As Variant, xDPathStr As Variant
Dim xVal As String
On Error Resume Next
Set xRg = Application.InputBox("Please select the file names:", "KuTools For Excel", ActiveWindow.RangeSelection.Address, , , , , 8)
If xRg Is Nothing Then Exit Sub
Set xSFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
xSFileDlg.Title = "Please select the original folder:"
If xSFileDlg.Show <> -1 Then Exit Sub
xSPathStr = xSFileDlg.SelectedItems.Item(1) & "\"
Set xDFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
xDFileDlg.Title = "Please select the destination folder:"
If xDFileDlg.Show <> -1 Then Exit Sub
xDPathStr = xDFileDlg.SelectedItems.Item(1) & "\"
For Each xCell In xRg
xVal = xCell.Value
If TypeName(xVal) = "String" And xVal <> "" Then
FileCopy xSPathStr & xVal, xDPathStr & xVal
End If
Next
End Sub
 
Có bác nào giải thích giúp em từ các câu lệnh dưới này với ạ

Sub copyfiles()
'Updateby Extendoffice
Dim xRg As Range, xCell As Range
Dim xSFileDlg As FileDialog, xDFileDlg As FileDialog
Dim xSPathStr As Variant, xDPathStr As Variant
Dim xVal As String
On Error Resume Next
Set xRg = Application.InputBox("Please select the file names:", "KuTools For Excel", ActiveWindow.RangeSelection.Address, , , , , 8)
If xRg Is Nothing Then Exit Sub
Set xSFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
xSFileDlg.Title = "Please select the original folder:"
If xSFileDlg.Show <> -1 Then Exit Sub
xSPathStr = xSFileDlg.SelectedItems.Item(1) & "\"
Set xDFileDlg = Application.FileDialog(msoFileDialogFolderPicker)
xDFileDlg.Title = "Please select the destination folder:"
If xDFileDlg.Show <> -1 Then Exit Sub
xDPathStr = xDFileDlg.SelectedItems.Item(1) & "\"
For Each xCell In xRg
xVal = xCell.Value
If TypeName(xVal) = "String" And xVal <> "" Then
FileCopy xSPathStr & xVal, xDPathStr & xVal
End If
Next
End Sub
Thầy làm ơn chỉ hỏi cái gì không biết trong đống đấy thôi, chứ thầy bắt mọi người dịch hết thì ít ai rảnh lắm.
 
Upvote 0
Thầy làm ơn chỉ hỏi cái gì không biết trong đống đấy thôi, chứ thầy bắt mọi người dịch hết thì ít ai rảnh lắm.
Ở đây có cả đống ngừoi ở không, sẵn sàng làm. Hỏi cứ việc hỏi.

@thớt: Câu hỏi không "ngu". Nhưng cái tiêu đề này nó "ngu" thật.
 
Upvote 0
Thầy làm ơn chỉ hỏi cái gì không biết trong đống đấy thôi, chứ thầy bắt mọi người dịch hết thì ít ai rảnh lắm.
Nhiều người đói bài lắm. Còn tranh nhau đấy. Anh nhanh chân thì cười đắc thắng, anh chậm chân thì than trời.
 
Upvote 0
Web KT

Bài viết mới nhất

Back
Top Bottom