Newbie: How to Print by VBA a Single Page in a Worksheet

  • Thread starter Thread starter L.A. Lawyer
  • Start date Start date
L

L.A. Lawyer

I want to create a VBA snippet that will only print a single named page in a
worksheet to a txt file called "c:\info\excel.txt".

How is that done?
 
One way is to copy the sheet to a new workbook and save it from there, then
close that workbook:

Option Explicit
Sub testme01()

ActiveSheet.Copy 'to a new workbook

With ActiveWorkbook
.SaveAs Filename:="c:\info\excel.txt", FileFormat:=xlText
.Close savechanges:=False
End With

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.

Ask a Question

Back
Top