• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Create Excel Workbook

nagovind

Member
Dear all


I have a Workbook with one sheet.


I need a program so that the sheet has to copied and a............... new work sheet to be created in a pre defined folder / directory ...then....inside that new workbook ...sheet the content of the original to be pasted


Separately


I will define the folder path


I will define the file name of the work sheet to be created


Please provide me a macro code
 
Navogind

Why don't you post your code as others may be interested to see your solution.
 
Dear Mr. Hui

Yes you are right

this is the code


Sub Macro2()

Sheets("Sheet1").Select

Sheets("Sheet1").Copy

ChDir "C:Media"

ActiveWorkbook.SaveAs Filename:="C:MediaBook5.xls", FileFormat:=xlNormal _

, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _

CreateBackup:=False

ActiveWindow.Close

End Sub


This code may be improved to have more sophistication on the pre defined dir and the file name
 
Dear Mr. Hui


this is the code


(Sub Macro2()


Sheets("Sheet1").Select

Sheets("Sheet1").Copy

ChDir "C:Media"

ActiveWorkbook.SaveAs Filename:="C:MediaBook5.xls", FileFormat:=xlNormal _

, Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _

CreateBackup:=False

ActiveWindow.Close

End Sub)
 
Dear Mr. Hui


this is the code


...Sub Macro2()


... Sheets("Sheet1").Select

... Sheets("Sheet1").Copy

...ChDir "C:Media"

...ActiveWorkbook.SaveAs Filename:="C:MediaBook5.xls", FileFormat:=xlNormal _

... , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _

... CreateBackup:=False

...ActiveWindow.Close

...End Sub
 
Back
Top