quangdiepctmbk
Thành viên hoạt động



- Tham gia
- 2/4/08
- Bài viết
- 169
- Được thích
- 52
- Nghề nghiệp
- Ky su
Bạn nào giúp mình viết code như sau : lưu một vùng dữ liệu file excel A thành một file mới định dạng csv.
Ví dụ mình muốn lưu vùng dữ liệu từ A2:E100 của file A thành một file csv mới.1 vùng dữ liệu thì nó như thế nào thì mới code đc chứ? Bạn nghiên cứu về save as file nhé.
~~> https://www.extendoffice.com/documents/excel/626-excel-save-selection.html#kutoolsBạn nào giúp mình với!
Bạn nào giúp mình với!
Sub SaveCSV()
Dim Tm
Tm = Worksheets("DATA").Range("A2:E100")
With Workbooks.Add
.Sheets(1).Range("A2:E100") = Tm
Application.CutCopyMode = False
.SaveAs Filename:="C:\Users\Admin\Desktop\Sealand.csv", _
FileFormat:=xlCSV, CreateBackup:=False
.Save
.Close
End With
End Sub