Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

macro-exporting to new workbook

Status
Not open for further replies.

gray78

Programmer
Feb 3, 2005
78
US
I have a macro but need the code to export the data (and headings) to a new workbook. How is this done using VB code?

Thanks
DK
 
hello there!
were are you exporting from? excel, access, text file?
If it is excel then you can use the macro below...
Code:
Sub export()

' export Macro

    ActiveWorkbook.SaveAs Filename:= _
        "filepath\name.xls", FileFormat:=xlNormal _
        , Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
        CreateBackup:=False
End Sub

you will need to change the filepath and name of the file to your save location...and you can add a password or change the False settings to True if needed...

hth~
Boni
:eek:)

Boni J. Rychener
Hammerman Associates, Inc.
Crystal Training and Crystal Material
On-site and public classes
Low-cost telephone/email support
FREE independent Crystal newsletter
800-783-2269
 


Hi,

If you turn on your Macro Recorder and go thru the process of doing what you want, your'd at least have a starting point for a macro.

Skip,

[glasses] [red]A palindrome gone wrong?[/red]
A man, a plan, a ROOT canal...
PULLEMALL![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top