Hello
I have this macro to export data for the last sheet by new file , but what I want just copy the values from column F (BALANCE) for file STOCK1 to column C (STOCK) with clears others column for new file . I put the result in new file REPORT how should be .
the macro is existed in file STOCK 1 and will also be in new file as in XLSM after run the macro because I need it the codes for each new file .
Sub gg()
On Error Resume Next
Application.ScreenUpdating = False
Application.DisplayAlerts = False
TryAgain:
Flname = InputBox("Enter File Name :", "Creating New File...")
MsgBox Len(Flname)
If Flname <> "" Then
Set NewWkbk = Workbooks.Add
ThisWorkbook.Sheets(3).Copy NewWkbk.Sheets(1)
NewWkbk.SaveAs ThisWorkbook.Path & "\" & Flname, FileFormat:=xlOpenXMLWorkbookMacroEnabled
If Err.Number = 1004 Then
NewWkbk.Close
MsgBox "File Name Not Valid" & vbCrLf & vbCrLf & "Try Again."
GoTo TryAgain
End If
ActiveWorkbook.Close
End If
best regards,
Tubrak