macro

  • Thread starter Thread starter Baskaran
  • Start date Start date
B

Baskaran

pls let me know how to collect details from the spreadsheet and placing in
text file using macros.
 
This is what you get when you use the macro recorder with your source workbook
open.

Sub Macro6()
Range("A1:F34").Select 'collect the details
Selection.Copy
'open a new workbook
Workbooks.Add Template:="Workbook"
Range("A1").Select
ActiveSheet.Paste 'paste the copied details to new book
Range("A1").Select
Application.CutCopyMode = False
'now save the new book as s *.txt file
ActiveWorkbook.SaveAs Filename:= _
"C:\Program Files\Microsoft Office\exceldata\Book1.txt", _
FileFormat:=xlText, _
CreateBackup:=False
ActiveWorkbook.Save
ActiveWindow.Close
End Sub


Gord Dibben MS Excel MVP
 

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.

Ask a Question

Similar Threads

About Macros 1
macros off 1
what is the best book to learn macros indepth 4
inserting rows inbetween rows of data ? 1
Regarding Macro's 1
Search OF Macros for a specific phrase 2
Macro 3
MACRO 5

Back
Top