Hello,
I use this code to export a data from the sheet_1 from a unopen file to the actual workbook by using a macro
This is the code :
My problem when I select a normal xlsx file it works perfectly, now the format of the file change in CSV because we are exporting data weekly from your website.
I tried the code but the placement are not good.
U can see that on the images :
I would like some help.
I use this code to export a data from the sheet_1 from a unopen file to the actual workbook by using a macro
This is the code :
VBA Code:
Public Sub Export()
Dim Wrkb_1 As Workbook
Dim Wrkb_2 As Workbook
Dim Way As String
With Application.FileDialog(msoFileDialogFilePicker)
If .Show <> 0 Then
Way = .SelectedItems(1)
Set Wrkb_1 = Workbooks.Open(Way)
Set Wrkb_2 = Workbooks("Template_File.xlsm")
Wrkb_1.Sheets("export_week1").Activate
Last_ligne = Wrkb_1.Sheets("export_week1").Cells(Rows.Count, "A").End(xlUp).Row
Wrkb_1.Sheets("export_week1").Range("A1:AG" & Last_ligne).Copy
Wrkb_2.Sheets("Export_1").Activate
Range("A1").Select
ActiveSheet.Paste
Application.CutCopyMode = False
Wrkb_1.Close
Else
MsgBox "Mission failed"
Exit Sub
End If
End With
End Sub
My problem when I select a normal xlsx file it works perfectly, now the format of the file change in CSV because we are exporting data weekly from your website.
I tried the code but the placement are not good.
U can see that on the images :
I would like some help.