vba copy
Posted: Wed Aug 10, 2022 7:05 am
#needhelp
Hi Dear!
I need help with the code. I want that relevant tab to be exported in XLSX form as well in the relevant folder. I have tried different codes myself but unfortunately couldn't be succeeded.
I shall be grateful for the help. Thanks.
Thank you for kind help
Hi Dear!
I need help with the code. I want that relevant tab to be exported in XLSX form as well in the relevant folder. I have tried different codes myself but unfortunately couldn't be succeeded.
I shall be grateful for the help. Thanks.
Code: Select all
Sub nn()
Dim wb As Workbook
On Error Goto Handler
Application.ScreenUpdating=False
Application.DisplayAlerts=False
Const X As String= "C:\ABC" & Sheets(1).Range("h3").Value &"_"&Format(Now,"HHMMSS")
Set wb=Workbooks.Add
Sheets("Invoice").Copy after:=wb.Sheets(wb.Sheets.Count)
wb.Sheets(1).Delete
wb.SaveAs Filename:=X &".xlsx'" ,Fileformat:=51
Sheets("invoice"). Activate
wb.Close
Handler:
Application.ScreenUpdating=True
Application.DisplayAlerts=True
End Sub