Sub ABC()
Dim bk as Workbook, bk1 as Workbook
Set bk = ActiveWorkbook
Set bk1 = Workbooks.Add(xlWBATWorksheet)
bk.Names("MyRange").Copy bk1.Worksheets(1).Range("A1")
bk1.SaveAs Filename:="C:\Data\MyFile.txt", _
FileFormat:=xlText, CreateBackup:=False
bk1.close SaveChanges:=False
End Sub
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.